diff --git a/src/tests/test_check_functions.py b/src/tests/test_check_functions.py index bb8d71fe..b39a631b 100644 --- a/src/tests/test_check_functions.py +++ b/src/tests/test_check_functions.py @@ -2,20 +2,27 @@ import pytest from validator import global_data -from validator.check_functions import (has_correct_length, - has_no_conditional_field_conflict, - has_valid_enum_pair, - has_valid_fieldset_pair, - has_valid_format, - has_valid_multi_field_value_count, - has_valid_value_count, is_date, - is_greater_than, - is_greater_than_or_equal_to, - is_less_than, is_number, - is_unique_column, is_unique_in_field, - is_valid_code, is_valid_enum, - meets_multi_value_field_restriction, - string_contains) +from validator.check_functions import ( + has_correct_length, + has_no_conditional_field_conflict, + has_valid_enum_pair, + has_valid_fieldset_pair, + has_valid_format, + has_valid_multi_field_value_count, + has_valid_value_count, + is_date, + is_greater_than, + is_greater_than_or_equal_to, + is_less_than, + is_number, + is_unique_column, + is_unique_in_field, + is_valid_code, + is_valid_enum, + meets_multi_value_field_restriction, + string_contains, +) +from validator.checks import SBLCheck class TestInvalidDateFormat: @@ -864,11 +871,6 @@ def test_with_incorrect_values(self): is False ) - class TestSBLCheck: - import pytest - -from validator.checks import SBLCheck - class TestSBLCheck: def test_no_id_check(self): @@ -884,10 +886,11 @@ def test_no_name_check(self): assert "Each check must be assigned a `name` and an `id`." in str(exc.value) assert exc.type == ValueError + def test_name_and_id_check(self): raised = False try: SBLCheck(lambda: True, id="00000", warning=True, name="Just a Warning") - except: + except ValueError: raised = True - assert raised == False + assert raised is False