diff options
| -rw-r--r-- | tests/uploader/genotypes/test_genotype_views.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/uploader/genotypes/test_genotype_views.py b/tests/uploader/genotypes/test_genotype_views.py new file mode 100644 index 0000000..f5c234b --- /dev/null +++ b/tests/uploader/genotypes/test_genotype_views.py @@ -0,0 +1,23 @@ +"""Tests for the genotype views helpers.""" +import pytest + +from uploader.genotypes.views import parse_missing_values_symbols + + +@pytest.mark.unit_test +@pytest.mark.parametrize( + "value,expected", + (("N", ["N"]), + ("N ?", ["N", "?"]), + ("N, ?", ["N", "?"]), + (" N,,? ", ["N", "?"]), + ("N N", ["N"]), + ("", []), + (" ", []))) +def test_parse_missing_values_symbols(value, expected): + """ + GIVEN: a whitespace- and/or comma-separated list of symbols + WHEN: the missing-value symbols are parsed + THEN: the unique, non-empty symbols are returned in order + """ + assert parse_missing_values_symbols(value) == expected |
