From f15fac33627952ccf5d85a8c363b6d829c03b90d Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 11 Apr 2022 15:24:31 +0300 Subject: Add tests for headers * Add tests to check for validity of the headers * Add stubs for the tests --- tests/qc/test_header.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tests/qc/test_header.py (limited to 'tests/qc') diff --git a/tests/qc/test_header.py b/tests/qc/test_header.py new file mode 100644 index 0000000..2feac19 --- /dev/null +++ b/tests/qc/test_header.py @@ -0,0 +1,21 @@ +import pytest +from hypothesis import given +from hypothesis import strategies as st + +from quality_control.headers import valid_header +from quality_control.errors import InvalidHeaderValue + +@given(headers=st.lists(st.text(max_size=10))) +def test_valid_header_errors_with_invalid_headers(headers): + "Verify that the check for header validity works" + with pytest.raises(InvalidHeaderValue): + valid_header(("BXD1", "BXD2", "BXD3"), headers) + +@pytest.mark.parametrize( + "strains,headers", [ + (("BXD1", "BXD2", "BXD3"), ("ProbeSet", "BXD3", "BXD1")), + (("AStrain", "AnotherStrain", "YetAnotherStrain"), + ("Individual", "AStrain", "AnotherStrain", "YetAnotherStrain"))]) +def test_valid_header_strains_passes_with_valid_headers(strains, headers): + "Verify that the check for header validity works" + assert valid_header(strains, headers) -- cgit v1.2.3