def test_serialize_returns_deprecated_value(self): self.assertIsInstance(types.Deprecated().serialize('foobar'), types.DeprecatedValue)
def test_serialize_returns_deprecated_value(self): cv = types.Deprecated() result = cv.serialize("foobar") assert isinstance(result, types.DeprecatedValue)
def test_deserialize_deprecated_value(self): self.schema['foo'] = types.Deprecated() result, errors = self.schema.deserialize(self.values) self.assertItemsEqual(['bar', 'baz'], result.keys()) self.assertNotIn('foo', errors)
def test_deserialize_deprecated_value(self): self.schema["foo"] = types.Deprecated() result, errors = self.schema.deserialize(self.values) assert ["bar", "baz"] == sorted(result.keys()) assert "foo" not in errors