Пример #1
0
 def test_succeeding(series_values, allowed):
     """Run checks which should succeed"""
     check_values(series_values, Check.isin(allowed), {})
Пример #2
0
 def test_failing(values, allowed, failure_cases):
     """Run checks which should fail"""
     check_values(values, Check.isin(allowed), failure_cases)
     check_raise_error_or_warning(values, Check.isin(allowed))
Пример #3
0
 def test_failing(values, min_val, failure_cases):
     """Run checks which should fail"""
     check_values(values, Check.greater_than_or_equal_to(min_val),
                  failure_cases)
     check_raise_error_or_warning(values,
                                  Check.greater_than_or_equal_to(min_val))
Пример #4
0
 def test_failing(values, value, failure_cases):
     """Run checks which should fail"""
     check_values(values, Check.not_equal_to(value), failure_cases)
     check_raise_error_or_warning(values, Check.not_equal_to(value))
Пример #5
0
 def test_failing(series_values, pattern, failure_cases):
     """Run checks which should fail"""
     check_values(series_values, Check.str_matches(pattern), failure_cases)
     check_raise_error_or_warning(series_values, Check.str_matches(pattern))
Пример #6
0
 def test_argument_check(pattern):
     """Test invalid arguments"""
     with pytest.raises(ValueError):
         Check.str_contains(pattern)
Пример #7
0
 def test_succeeding(values, check_args):
     """Run checks which should succeed"""
     check_values(values, Check.in_range(*check_args), {})
Пример #8
0
 def test_succeeding(series_values, forbidden):
     """Run checks which should succeed"""
     check_values(series_values, Check.notin(forbidden), {})
Пример #9
0
 def test_failing(values, max_value, failure_cases):
     """Run checks which should fail"""
     check_values(values, Check.less_than_or_equal_to(max_value),
                  failure_cases)
     check_raise_error_or_warning(values,
                                  Check.less_than_or_equal_to(max_value))
Пример #10
0
 def test_failing_with_none(values, max_value):
     """Validate the check works also on dataframes with None values"""
     check_none_failures(values, Check.less_than_or_equal_to(max_value))
Пример #11
0
 def test_succeeding(values, max_value):
     """Run checks which should succeed"""
     check_values(values, Check.less_than_or_equal_to(max_value), {})
Пример #12
0
 def test_argument_check():
     """Test if None is accepted as boundary"""
     with pytest.raises(ValueError):
         Check.less_than_or_equal_to(max_value=None)
Пример #13
0
 def test_failing_with_none(values, min_val):
     """Validate the check works also on dataframes with None values"""
     check_none_failures(values, Check.greater_than_or_equal_to(min_val))
Пример #14
0
 def test_failing_with_none(values, allowed):
     """Validate the check works also on dataframes with None values"""
     check_none_failures(values, Check.isin(allowed))
Пример #15
0
 def test_failing(values, check_args, failure_cases):
     """Run checks which should fail"""
     check_values(values, Check.in_range(*check_args), failure_cases)
     check_raise_error_or_warning(values, Check.in_range(*check_args))
Пример #16
0
 def test_argument_check(args):
     """Test invalid arguments"""
     with pytest.raises(ValueError):
         Check.notin(*args)
Пример #17
0
 def test_failing_with_none(values, check_args):
     """Validate the check works also on dataframes with None values"""
     check_none_failures(values, Check.in_range(*check_args))
Пример #18
0
 def test_failing(series_values, forbidden, failure_cases):
     """Run checks which should fail"""
     check_values(series_values, Check.notin(forbidden), failure_cases)
     check_raise_error_or_warning(series_values, Check.notin(forbidden))
Пример #19
0
 def test_failing_with_none(series_values, value):
     """Validate the check works also on dataframes with None values"""
     check_none_failures(series_values, Check.equal_to(value))
Пример #20
0
 def test_failing_with_none(series_values, pattern):
     """Validate the check works also on dataframes with None values"""
     check_none_failures(series_values, Check.str_matches(pattern))
Пример #21
0
 def test_succeeding(series_values, value):
     """Run checks which should succeed"""
     check_values(series_values, Check.not_equal_to(value), {})
Пример #22
0
 def test_succeeding(series_values, pattern):
     """Run checks which should succeed"""
     check_values(series_values, Check.str_contains(pattern), {})
Пример #23
0
 def test_succeeding(values, min_val):
     """Run checks which should succeed"""
     check_values(values, Check.greater_than_or_equal_to(min_val), {})