aboutsummaryrefslogtreecommitdiff
path: root/tests/r_qtl
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-02-20 10:57:56 +0300
committerFrederick Muriuki Muriithi2024-02-20 10:57:56 +0300
commitce243a57b24d6adecb169487e706290d91b22d19 (patch)
tree6b0b06a444c16ffb8be1c65fa4e5b78ced6a0615 /tests/r_qtl
parenta4324cd24b5a14fbcf19a6e04d2b76fb2838038e (diff)
downloadgn-uploader-ce243a57b24d6adecb169487e706290d91b22d19.tar.gz
Track filename in the errors
R/qtl2 bundles can contain more than one file, of the same type. When errors are encountered in any of the files, we need to be able to inform the user which file it is, in addition to the line and column number.
Diffstat (limited to 'tests/r_qtl')
-rw-r--r--tests/r_qtl/test_r_qtl2_qc.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/tests/r_qtl/test_r_qtl2_qc.py b/tests/r_qtl/test_r_qtl2_qc.py
index d12172e..05db30e 100644
--- a/tests/r_qtl/test_r_qtl2_qc.py
+++ b/tests/r_qtl/test_r_qtl2_qc.py
@@ -124,9 +124,12 @@ def test_missing_files(filepath, expected):
("tests/r_qtl/test_files/test_geno.zip",
tuple()),
("tests/r_qtl/test_files/geno_with_missing_genotypes.zip",
- (InvalidValue(1, "AXR-1", "X", "Invalid value 'X'. Expected one of ('L', 'C')."),
- InvalidValue(2, "EC.480C", "Y", "Invalid value 'Y'. Expected one of ('L', 'C')."),
- InvalidValue(6, "HH.335C-Col/PhyA", "H", f"Invalid value 'H'. Expected one of ('L', 'C').")))))
+ (InvalidValue("geno", 1, "AXR-1", "X",
+ "Invalid value 'X'. Expected one of ('L', 'C')."),
+ InvalidValue("geno", 2, "EC.480C",
+ "Y", "Invalid value 'Y'. Expected one of ('L', 'C')."),
+ InvalidValue("geno", 6, "HH.335C-Col/PhyA", "H",
+ f"Invalid value 'H'. Expected one of ('L', 'C').")))))
def test_geno_errors(filepath, expected):
"""
GIVEN: A R/qtl2 bundle
@@ -145,10 +148,12 @@ def test_geno_errors(filepath, expected):
("tests/r_qtl/test_files/pheno_without_errors.zip",
tuple()),
("tests/r_qtl/test_files/pheno_with_errors.zip",
- (InvalidValue(1, "liver", "61.92", ("Invalid value '61.92'. Expected numerical value "
- "with at least 3 decimal places.")),
- InvalidValue(2, "spleen", "brrr", ("Invalid value 'brrr'. Expected numerical value "
- "with at least 3 decimal places."))))))
+ (InvalidValue("pheno", 1, "liver", "61.92", (
+ "Invalid value '61.92'. Expected numerical value "
+ "with at least 3 decimal places.")),
+ InvalidValue("pheno", 2, "spleen", "brrr", (
+ "Invalid value 'brrr'. Expected numerical value "
+ "with at least 3 decimal places."))))))
def test_pheno_errors(filepath, expected):
"""
GIVEN: A R/qtl2 bundle