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_standard_error.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_standard_error.py')
-rw-r--r-- | tests/qc/test_cells_standard_error.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/qc/test_cells_standard_error.py b/tests/qc/test_cells_standard_error.py new file mode 100644 index 0000000..aa25aa8 --- /dev/null +++ b/tests/qc/test_cells_standard_error.py @@ -0,0 +1,20 @@ +import re +from random import randint + + +from hypothesis import given +from hypothesis import strategies as st + +from quality_control.standard_error import invalid_value + +@given(num_str=st.from_regex(r"^[0-9]+\.?0*", fullmatch=True)) +def test_cell_standard_error_value_errors_if_less_than_six_decimal_places2(num_str): + """ + GIVEN: `num_str` is a string representing a whole number (e.g 5, 33, 5453 + etc) or a number with all zeroes for the decimals (e.g 0.0, 19.00000, + 45842.00 etc) + WHEN: `num_str` is provided as an argument to `se_invalid_value` function, + THEN: `se_invalid_value` returns a `None`. + """ + line, col = randint(0, 100), randint(0, 20) + assert invalid_value(line, col, num_str) is None |