aboutsummaryrefslogtreecommitdiff
path: root/tests/qc/test_cells.py
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/qc/test_cells.py
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/qc/test_cells.py')
-rw-r--r--tests/qc/test_cells.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/qc/test_cells.py b/tests/qc/test_cells.py
index e4a0959..937579f 100644
--- a/tests/qc/test_cells.py
+++ b/tests/qc/test_cells.py
@@ -22,12 +22,12 @@ def test_cell_value_errors_with_invalid_inputs2(num_str):
`quality_control.errors.InvalidValue` object which holds the error
information.
"""
- assert avg_invalid_value(0, 0, num_str) == InvalidValue(
- 0, 0, num_str, (
+ assert avg_invalid_value("test.file", 0, 0, num_str) == InvalidValue(
+ "test.file", 0, 0, num_str, (
f"Invalid value '{num_str}'. Expected string representing a number "
"with exactly three decimal places."))
- assert se_invalid_value(0, 0, num_str) == InvalidValue(
- 0, 0, num_str, (
+ assert se_invalid_value("test.file", 0, 0, num_str) == InvalidValue(
+ "test.file", 0, 0, num_str, (
f"Invalid value '{num_str}'. Expected string representing a number "
"with at least six decimal places."))
@@ -43,8 +43,8 @@ def test_cell_average_value_errors_if_not_three_decimal_places2(num_str):
object with the information about the placement of the invalid value.
"""
line, col = randint(0, 100), randint(0, 20)
- assert avg_invalid_value(line, col, num_str) == InvalidValue(
- line, col, num_str, (
+ assert avg_invalid_value("test.file", line, col, num_str) == InvalidValue(
+ "test.file", line, col, num_str, (
f"Invalid value '{num_str}'. Expected string representing a number "
"with exactly three decimal places."))
@@ -57,7 +57,7 @@ def test_cell_average_value_pass_if_three_decimal_places(num_str):
THEN: `avg_invalid_value` returns `None`
"""
line, col = randint(0, 100), randint(0, 20)
- assert avg_invalid_value(line, col, num_str) is None
+ assert avg_invalid_value("test.file", line, col, num_str) is None
@given(num_str=st.from_regex(r"^[0-9]+\.([0-9]{0,5}$)", fullmatch=True).filter(
lambda param: not re.match(r"^[0-9]+\.?0*$", param)))
@@ -70,8 +70,8 @@ def test_cell_standard_error_value_errors_if_less_than_six_decimal_places2(num_s
object with the information about the placement of the invalid value.
"""
line, col = randint(0, 100), randint(0, 20)
- assert se_invalid_value(line, col, num_str) == InvalidValue(
- line, col, num_str, (
+ assert se_invalid_value("test.file", line, col, num_str) == InvalidValue(
+ "test.file", line, col, num_str, (
f"Invalid value '{num_str}'. Expected string representing a number "
"with at least six decimal places."))
@@ -84,4 +84,4 @@ def test_cell_standard_error_value_pass_if_six_or_more_decimal_places(num_str):
THEN: `se_invalid_value` returns `None`
"""
line, col = randint(0, 100), randint(0, 20)
- assert se_invalid_value(line, col, num_str) is None
+ assert se_invalid_value("test.file", line, col, num_str) is None