示例#1
0
 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)
示例#2
0
 def test_validator(self):
     schema = Schema()
     schema._validators = MagicMock()
     assert schema.validator('asdf') == 'asdf'
     schema._validators.append.assert_called_once_with('asdf')