def test_proxy_autotype(self): from jsonable_objects.proxy import proxy from jsonable_objects.proxy import Field @proxy(dict) class Foo(object): id = Field(type=int) foo = Field(proxy=Foo) self.assertTrue(foo.type is dict)
class Foo(object): ''' Foo ''' id = Field()
class Foo(object): bar = Field(type=dict, proxy=Bar)
class Seq(object): foo = Field()
class Content(Node, User): content = Field(type=str)
class Node(object): id = Field(type=int)
class Qux(object): foo = Field(proxy=Foo) bar = Field(proxy=Bar)
class Foo(object): bar = Field(type=dict, optional=True, proxy=Bar, format=barFormat)
class Foo(object): bar = Field(type=dict)
class Foo(object): bar = Field(type=str)
class Foo(object): bar = Field(type=float)
class Foo(object): bar = Field(type=int, optional=True)
class Foo(object): bar = Field(type=int)
class Foo(object): bar = Field(optional=True)
class Foo(object): bar = Field()
class Foo(object): bar = Field(type=dict, optional=True, proxy=Bar)
class Bar(object): id = Field(type=int)
class Foo(object): bar = Field(predicate=lambda value: value >= 0)
class Bar(object): foo = Field(key='foo-in-bar', proxy=Foo)
class Foo(object): bar = Field(type=int, predicate=lambda value: value >= 0)
class Foo(object): id = Field(type=int)
class Foo(object): uuid = Field(type=str, format=uuidFormat)
class User(Node): name = Field(type=str)
class Foo(object): uuid = Field(type=str, optional=True, format=uuidFormat)
class Foo(object): id = Field()
class Foo(object): bar = Field(type=list)