diff options
author | Frederick Muriuki Muriithi | 2022-11-16 04:16:01 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2022-11-16 04:16:01 +0300 |
commit | d511e44b1a2b0e70236831926d86a10d589e9235 (patch) | |
tree | 7e5ca3dbe0eb18c3dd2cb19b4fbbb1278cce9be3 /tests/qc/test_cells.py | |
parent | 838049cedefc5209ff9666624b2b24eccb120fb8 (diff) | |
download | gn-uploader-d511e44b1a2b0e70236831926d86a10d589e9235.tar.gz |
qc: Allow whole numbers or numbers where the decimals are all zeroes
Diffstat (limited to 'tests/qc/test_cells.py')
-rw-r--r-- | tests/qc/test_cells.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/qc/test_cells.py b/tests/qc/test_cells.py index 5ff5813..1c6c3f6 100644 --- a/tests/qc/test_cells.py +++ b/tests/qc/test_cells.py @@ -10,7 +10,7 @@ from quality_control.average import invalid_value as avg_invalid_value from quality_control.standard_error import invalid_value as se_invalid_value @given(num_str=st.from_regex( - r"^(?!(([0-9]+\.([0-9]{3}|[0-9]{6,}))|0+\.?0*)).*", fullmatch=True)) + r"^(?!(([0-9]+\.([0-9]{3}|[0-9]{6,}))|[0-9]+\.?0*)).*", fullmatch=True)) def test_cell_value_errors_with_invalid_inputs2(num_str): """ GIVEN: `num_str` is an arbitrary string that is an invalid input, @@ -30,7 +30,7 @@ def test_cell_value_errors_with_invalid_inputs2(num_str): @given(num_str=st.from_regex( r"^[0-9]+\.([0-9]{1,2}|[0-9]{4,}$)", fullmatch=True).filter( - lambda param: not re.match(r"0\.0+", param))) + lambda param: not re.match(r"^[0-9]+\.0+$", param))) def test_cell_average_value_errors_if_not_three_decimal_places2(num_str): """ GIVEN: `num_str` is a string representing a number with less than or more @@ -57,7 +57,7 @@ def test_cell_average_value_pass_if_three_decimal_places(num_str): assert avg_invalid_value(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\.0+", param))) + lambda param: not re.match(r"^[0-9]+\.?0*$", param))) def test_cell_standard_error_value_errors_if_less_than_six_decimal_places2(num_str): """ GIVEN: `num_str` is a string representing a number with less than six |