

def test_range(self):
    schema = schemas.RangeField.definition()
    definition = schema.deserialize({
        'name': 'age',
        'type': 'range',
        'min': 0,
        'max': 100,
    })
    validator = schemas.RangeField.validation(**definition)
    self.assertEquals(30, validator.deserialize(30))
    self.assertRaises(colander.Invalid, validator.deserialize, (- 5))
    self.assertRaises(colander.Invalid, validator.deserialize, 120)

dataset/ETHPy150Open spiral-project/daybed/daybed/tests/test_schemas_base.py BaseFieldsTests.test_range/original