Beispiel #1
0
 def test_serialize_returns_deprecated_value(self):
     self.assertIsInstance(types.Deprecated().serialize('foobar'),
                           types.DeprecatedValue)
Beispiel #2
0
    def test_serialize_returns_deprecated_value(self):
        cv = types.Deprecated()

        result = cv.serialize("foobar")

        assert isinstance(result, types.DeprecatedValue)
Beispiel #3
0
    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)
Beispiel #4
0
    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