示例#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), {})