diff options
author | Frederick Muriuki Muriithi | 2024-02-28 10:55:00 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2024-02-28 10:55:00 +0300 |
commit | 9ab4316ee3c4d3068053c94334c64915514d8664 (patch) | |
tree | 0d8843b9ed6a6b461e007930a4e006fa89646fba | |
parent | dfd855acbf302e2d3b323f292da27796305fac76 (diff) | |
download | gn-uploader-9ab4316ee3c4d3068053c94334c64915514d8664.tar.gz |
tests: Update unit tests: remove use of obsoleted functions.
-rw-r--r-- | README.org | 11 | ||||
-rw-r--r-- | tests/r_qtl/test_r_qtl2_geno.py | 19 | ||||
-rw-r--r-- | tests/r_qtl/test_r_qtl2_pheno.py | 11 |
3 files changed, 33 insertions, 8 deletions
@@ -217,11 +217,20 @@ To check for correct type usage in the application, run: Run unit tests with: #+BEGIN_SRC shell - pytest -k unit_test + $ export QCAPP_CONF=</path/to/configuration/file.py> + $ pytest -k unit_test +#+END_SRC + +To run ALL tests (not just unit tests): +#+BEGIN_SRC shell + $ export QCAPP_CONF=</path/to/configuration/file.py> + $ pytest #+END_SRC ** Deploying/Installing QC +**NOTE**: All tests should pass before you deploy the uploader! + *** CLI: Docker Generate the docker image file with diff --git a/tests/r_qtl/test_r_qtl2_geno.py b/tests/r_qtl/test_r_qtl2_geno.py index d3c77e6..a1e69b7 100644 --- a/tests/r_qtl/test_r_qtl2_geno.py +++ b/tests/r_qtl/test_r_qtl2_geno.py @@ -273,12 +273,23 @@ def test_parse_founder_geno_files(relpath, expected): @pytest.mark.unit_test @pytest.mark.parametrize( - "filepath,expected", + "filepath,member,transposed,expected", (("tests/r_qtl/test_files/test_geno.zip", + "test_geno.csv", + False, ("1", "2", "3", "4", "5", "6", "7", "8", "9", "10")), ("tests/r_qtl/test_files/test_geno_transposed.zip", + "test_geno_transposed.csv", + True, ("1", "2", "3", "4", "5", "6", "7", "8", "9", "10")), ("tests/r_qtl/test_files/test_geno_multiple.zip", - ("1", "2", "3", "4", "5", "6", "7", "8", "9", "10")))) -def test_load_geno_samples(filepath, expected): - assert sorted(rqtl2.load_geno_samples(filepath)) == sorted(expected) + "test_geno_multiple01.csv", + False, + ("1", "2", "3", "4", "5")), + ("tests/r_qtl/test_files/test_geno_multiple.zip", + "test_geno_multiple02.csv", + False, + ("6", "7", "8", "9", "10")))) +def test_load_geno_samples(filepath, member, transposed, expected): + assert sorted(rqtl2.load_samples( + filepath, member, transposed)) == sorted(expected) diff --git a/tests/r_qtl/test_r_qtl2_pheno.py b/tests/r_qtl/test_r_qtl2_pheno.py index d31ad54..54244fc 100644 --- a/tests/r_qtl/test_r_qtl2_pheno.py +++ b/tests/r_qtl/test_r_qtl2_pheno.py @@ -61,10 +61,15 @@ def test_parse_phenocovar_files(filepath, expected): @pytest.mark.unit_test @pytest.mark.parametrize( - "filepath,expected", + "filepath,member,transposed,expected", (("tests/r_qtl/test_files/test_pheno.zip", + "test_pheno.csv", + False, ("1", "2", "3", "4", "5")), ("tests/r_qtl/test_files/test_pheno_transposed.zip", + "test_pheno_transposed.csv", + True, ("1", "2", "3", "4", "5")))) -def test_load_geno_samples(filepath, expected): - assert sorted(rqtl2.load_pheno_samples(filepath)) == sorted(expected) +def test_load_geno_samples(filepath, member, transposed, expected): + assert sorted(rqtl2.load_samples( + filepath, member, transposed)) == sorted(expected) |