diff options
| author | pi coding agent <pi@localhost> | 2026-11-05 19:18:56 +0000 |
|---|---|---|
| committer | Frederick Muriuki Muriithi <fredmanglis@gmail.com> | 2026-11-05 13:35:16 -0600 |
| commit | a2edcd3ea33acd5e254c6c449e712adbbe9bd7a8 (patch) | |
| tree | 411ff448da9190d7798f51f5a944f09b2c30b153 /tests | |
| parent | af315a45e9932fe8afed148ed81e69fc7c3a975d (diff) | |
| download | gn-uploader-a2edcd3ea33acd5e254c6c449e712adbbe9bd7a8.tar.gz | |
Test: cover parsing missing-value symbols
Add tests for splitting a whitespace- and/or comma-separated symbol list into unique, non-empty symbols.
Diffstat (limited to 'tests')
| -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 |
