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