def test_validator_schema(self): schema = Schema() schema._validators = MagicMock() func = lambda cfg: cfg assert validator(schema)(func) is func schema._validators.append.assert_called_once_with(func)
def test_validator(self): schema = Schema() schema._validators = MagicMock() assert schema.validator('asdf') == 'asdf' schema._validators.append.assert_called_once_with('asdf')