def test_boxed_alias(): w = Way(u'.') assert w.value == u'.' assert Way(Path(u'.')).value == u'.' assert Way.__nirum_deserialize__(u'.') == Way(u'.') assert Way(u'.').__nirum_serialize__() == u'.' assert Name(u'khj') == Irum(u'khj') assert Irum.__nirum_deserialize__(u'khj') == Irum(u'khj') assert Irum(u'khj').__nirum_serialize__() == u'khj' assert Irum.__nirum_deserialize__(u'khj') == Name(u'khj') assert Irum.__nirum_deserialize__(u'khj') == Irum(u'khj')
def test_set_serializer(): people = People(people={ Person(first_name=Name(u'First'), last_name=Name(u'Last')), }) assert people.__nirum_serialize__() == { '_type': 'people', 'people': [ { '_type': 'person', 'first_name': u'First', 'last_name': u'Last', }, ] }