Example #1
0
 def test_from_xml_nested_deep_structure(self):
     obj = XMLSerializerMixin.from_xml(nested_dic_lst_tup_xml)
     self.failUnless(
         self.nested.lst[0].myfoo.y == obj.lst[0].myfoo.y
         and self.nested.lst[0].s == obj.lst[0].s
         and self.nested.lst[0].x == obj.lst[0].x
         and self.nested.tup[0].rc.x == obj.tup[0].rc.x
         and self.nested.tup[1].pkgd.x == obj.tup[1].pkgd.x
         and self.nested.dic.keys()[0].y == obj.dic.keys()[0].y
         and self.nested.dic.values()[0].x == obj.dic.values()[0].x
         )
Example #2
0
 def test_from_xml_class_in_nested_package(self):
     obj = XMLSerializerMixin.from_xml(pkgd_cls_xml)
     self.failUnless(obj.pkgd.x == self.pkgd.pkgd.x)
Example #3
0
 def test_from_xml_random_class(self):
     obj = XMLSerializerMixin.from_xml(rand_xml)
     self.failUnless(self.rand.rc.x == obj.rc.x)
Example #4
0
 def test_from_xml_tuple(self):
     obj = XMLSerializerMixin.from_xml(tup_xml)
     self.failUnless(obj.mytuple[0] == 1 and
                     obj.mytuple[1] == 'hola')
Example #5
0
 def test_from_xml_list(self):
     obj = XMLSerializerMixin.from_xml(lst_xml)
     self.failUnless(obj.mylist[0] == 1 and
                     obj.mylist[1] == 'hola')
Example #6
0
 def test_from_xml_dict(self):
     obj = XMLSerializerMixin.from_xml(dic_xml)
     self.failUnless(obj.mydict[1] == 'hola' and
                     obj.mydict[2]=='adios')