From a4324cd24b5a14fbcf19a6e04d2b76fb2838038e Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Tue, 20 Feb 2024 06:32:56 +0300 Subject: Generalise fetching of samples/cases/individuals. --- tests/r_qtl/test_r_qtl2_pheno.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests') diff --git a/tests/r_qtl/test_r_qtl2_pheno.py b/tests/r_qtl/test_r_qtl2_pheno.py index c7c0c86..d31ad54 100644 --- a/tests/r_qtl/test_r_qtl2_pheno.py +++ b/tests/r_qtl/test_r_qtl2_pheno.py @@ -57,3 +57,14 @@ def test_parse_phenocovar_files(filepath, expected): with ZipFile(Path(filepath).absolute(), "r") as zfile: cdata = rqtl2.control_data(zfile) assert tuple(rqtl2.file_data(zfile, "phenocovar", cdata)) == expected + + +@pytest.mark.unit_test +@pytest.mark.parametrize( + "filepath,expected", + (("tests/r_qtl/test_files/test_pheno.zip", + ("1", "2", "3", "4", "5")), + ("tests/r_qtl/test_files/test_pheno_transposed.zip", + ("1", "2", "3", "4", "5")))) +def test_load_geno_samples(filepath, expected): + assert sorted(rqtl2.load_pheno_samples(filepath)) == sorted(expected) -- cgit v1.2.3