aboutsummaryrefslogtreecommitdiff
path: root/tests/qc/test_cells.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-05-18 17:34:55 +0300
committerFrederick Muriuki Muriithi2022-05-18 17:36:16 +0300
commit347ca2fe50225b4736e69bb86d8b278818be40ac (patch)
treedf7fcab96bb0dfc44633e93b5875451dfd1af305 /tests/qc/test_cells.py
parent8f32812ce73193366ee00d883fd427c830f5a8e9 (diff)
downloadgn-uploader-347ca2fe50225b4736e69bb86d8b278818be40ac.tar.gz
Remove obsoleted code. Fix linting errors.
Remove the old code that relied on exceptions to parse errors in the uploaded files.
Diffstat (limited to 'tests/qc/test_cells.py')
-rw-r--r--tests/qc/test_cells.py56
1 files changed, 2 insertions, 54 deletions
diff --git a/tests/qc/test_cells.py b/tests/qc/test_cells.py
index 46aeb64..a38be30 100644
--- a/tests/qc/test_cells.py
+++ b/tests/qc/test_cells.py
@@ -1,64 +1,12 @@
"""Test that values in cells within a line fulfill the required criteria"""
-import pytest
from random import randint
from hypothesis import given
from hypothesis import strategies as st
from quality_control.errors import InvalidValue
-from quality_control.errors import InvalidCellValue
-from quality_control.average import (
- valid_value as avg_valid_value,
- invalid_value as avg_invalid_value)
-from quality_control.standard_error import (
- valid_value as se_valid_value,
- invalid_value as se_invalid_value)
-
-@given(num_str=st.from_regex(
- r"^(?!([0-9]+\.([0-9]{3}|[0-9]{6,}))).*", fullmatch=True))
-def test_cell_value_errors_with_invalid_inputs(num_str):
- """Check that an error is raised for a cell with an invalid value."""
- with pytest.raises(InvalidCellValue):
- avg_valid_value(num_str)
- with pytest.raises(InvalidCellValue):
- se_valid_value(num_str)
-
-@given(num_str=st.from_regex(
- r"^[0-9]+\.([0-9]{1,2}|[0-9]{4,}$)", fullmatch=True))
-def test_cell_average_value_errors_if_not_three_decimal_places(num_str):
- """Check that an error is raised if the average value does not have 3 decimal places"""
- with pytest.raises(InvalidCellValue):
- avg_valid_value(num_str)
-
-@given(num_str=st.from_regex(r"^[0-9]+\.[0-9]{3}$", fullmatch=True))
-def test_cell_average_value_pass_if_three_decimal_places(num_str):
- """Check that there is no error if the average value has 3 decimal places."""
- processed = avg_valid_value(num_str)
- assert (
- isinstance(processed, float) and
- processed == float(num_str))
-
-@given(num_str=st.from_regex(r"^[0-9]+\.([0-9]{0,5}$)", fullmatch=True))
-def test_cell_standard_error_value_errors_if_less_than_six_decimal_places(num_str):
- """
- Check that an error is raised if the standard error value does not have 6
- decimal places
- """
- with pytest.raises(InvalidCellValue):
- se_valid_value(num_str)
-
-@given(num_str=st.from_regex(r"^[0-9]+\.[0-9]{6,}$", fullmatch=True))
-def test_cell_standard_error_value_pass_if_six_or_more_decimal_places(num_str):
- """
- Check that there is no error if the standard error value has 3 decimal
- places.
- """
- processed = se_valid_value(num_str)
- assert (
- isinstance(processed, float) and
- processed == float(num_str))
-
-## ================================================================================
+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,}))).*", fullmatch=True))