about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorpi coding agent <pi@localhost>2026-11-05 19:18:56 +0000
committerFrederick Muriuki Muriithi <fredmanglis@gmail.com>2026-11-05 13:35:16 -0600
commita2edcd3ea33acd5e254c6c449e712adbbe9bd7a8 (patch)
tree411ff448da9190d7798f51f5a944f09b2c30b153 /tests
parentaf315a45e9932fe8afed148ed81e69fc7c3a975d (diff)
downloadgn-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.py23
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