blob: 754db221530c79bef19dacb5b871ff79d106006f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
"""Test standard error values."""
from random import randint
import pytest
from hypothesis import given
from hypothesis import strategies as st
from quality_control.standard_error import invalid_value
@pytest.mark.skip(reason=("Checks changed. We now enforce values must have at "
"least one decimal place"))
@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
|