Exemplo n.º 1
0
 def test_deserialize(self):
     field = DocumentMeta()
     value = {'page': {'offset': 1}}
     result = field.deserialize(value)
     assert result == value
Exemplo n.º 2
0
 def test_deserialize_incorrect_type(self):
     field = DocumentMeta()
     value = 1
     with pytest.raises(ValidationError) as excinfo:
         field.deserialize(value)
     assert excinfo.value.args[0] == 'Not a valid mapping type.'
 def test_deserialize(self):
     field = DocumentMeta()
     value = {"page": {"offset": 1}}
     result = field.deserialize(value)
     assert result == value