示例#1
0
class RoundsValidator(pv.DataFrameValidator):
    """
    Rounds dataframe validator
    """

    column_num = 5
    l_round = pv.IntegerColumnValidator(constants.ROUND,
                                        min_value=1,
                                        max_value=38)
    l_ghome = pv.IntegerColumnValidator(constants.GOALS_HOME, min_value=0)
    l_gaway = pv.IntegerColumnValidator(constants.GOALS_AWAY, min_value=0)
示例#2
0
 def test_is_invalid(self):
     column_validator = pv.IntegerColumnValidator('label2')
     self.assertFalse(column_validator.is_valid(self.dataframe))
示例#3
0
 def test_is_valid(self):
     column_validator = pv.IntegerColumnValidator('label1')
     self.assertTrue(column_validator.is_valid(self.dataframe))
class DataFrameValidatorFixture(pv.DataFrameValidator):
    """Fixture for testing the validation of column type."""
    integer_field = pv.IntegerColumnValidator('i')
    float_field = pv.FloatColumnValidator('f')