Esempio n. 1
0
 def test_succeeding(series_values, allowed):
     """Run checks which should succeed"""
     check_values(series_values, Check.isin(allowed), {})
Esempio n. 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))
Esempio n. 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))
Esempio n. 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))
Esempio n. 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))
Esempio n. 6
0
 def test_argument_check(pattern):
     """Test invalid arguments"""
     with pytest.raises(ValueError):
         Check.str_contains(pattern)
Esempio n. 7
0
 def test_succeeding(values, check_args):
     """Run checks which should succeed"""
     check_values(values, Check.in_range(*check_args), {})
Esempio n. 8
0
 def test_succeeding(series_values, forbidden):
     """Run checks which should succeed"""
     check_values(series_values, Check.notin(forbidden), {})
Esempio n. 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))
Esempio n. 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))
Esempio n. 11
0
 def test_succeeding(values, max_value):
     """Run checks which should succeed"""
     check_values(values, Check.less_than_or_equal_to(max_value), {})
Esempio n. 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)
Esempio n. 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))
Esempio n. 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))
Esempio n. 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))
Esempio n. 16
0
 def test_argument_check(args):
     """Test invalid arguments"""
     with pytest.raises(ValueError):
         Check.notin(*args)
Esempio n. 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))
Esempio n. 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))
Esempio n. 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))
Esempio n. 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))
Esempio n. 21
0
 def test_succeeding(series_values, value):
     """Run checks which should succeed"""
     check_values(series_values, Check.not_equal_to(value), {})
Esempio n. 22
0
 def test_succeeding(series_values, pattern):
     """Run checks which should succeed"""
     check_values(series_values, Check.str_contains(pattern), {})
Esempio n. 23
0
 def test_succeeding(values, min_val):
     """Run checks which should succeed"""
     check_values(values, Check.greater_than_or_equal_to(min_val), {})