Exemplo n.º 1
0
    def test_to_dict_obj(self):
        class Foo(object):
            def __init__(self):
                self.foo = 42

        expected = {"foo": 42}
        assert fields.to_marshallable_type(Foo()) == expected
Exemplo n.º 2
0
    def test_to_dict_custom_marshal(self):
        class Foo(object):
            def __marshallable__(self):
                return {"foo": 42}

        expected = {"foo": 42}
        assert fields.to_marshallable_type(Foo()) == expected
Exemplo n.º 3
0
 def test_to_dict(self):
     expected = data = {"foo": 42}
     assert fields.to_marshallable_type(data) == expected