def test_serialize(self): field = ResourceMeta() result = field.serialize('resource_meta', {'resource_meta': { 'active': True }}) assert result == {'active': True}
def test_serialize(self): field = ResourceMeta() result = field.serialize("resource_meta", {"resource_meta": { "active": True }}) assert result == {"active": True}
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.'
def test_deserialize(self): field = ResourceMeta() value = {'active': True} result = field.deserialize(value) assert result == value
def test_serialize_incorrect_type(self): field = ResourceMeta() with pytest.raises(ValidationError) as excinfo: field.serialize('resource_meta', {'resource_meta': True}) assert excinfo.value.args[0] == 'Not a valid mapping type.'