コード例 #1
0
 def test_deserialize_incorrect_type(self):
     field = ResourceMeta()
     value = True
     with pytest.raises(ValidationError) as excinfo:
         field.deserialize(value)
     assert excinfo.value.args[0] == 'Not a valid mapping type.'
コード例 #2
0
 def test_deserialize(self):
     field = ResourceMeta()
     value = {'active': True}
     result = field.deserialize(value)
     assert result == value