コード例 #1
0
 def test_pools_json(self):
     actual_json = """
                     {{ "{root_tag}":
                         [{{
                             {actual_json_base}
                         }}]
                     }}
                     """.format(root_tag=self.ROOT_TAG,
                                actual_json_base=self.actual_json_base,
                                **self.pool_attribute_kwargs)
     actual_obj = Pools.deserialize(actual_json, 'json')
     self.assertEqual(self.expected_obj, actual_obj)
コード例 #2
0
 def test_pools_xml(self):
     actual_xml = """{xml_header}
                         <{root_tag} xmlns="{xmlns}">
                             <{child_tag}
                                 {actual_xml_base}
                             </{child_tag}>
                         </{root_tag}>""".format(
         xml_header=self.XML_HEADER,
         xmlns=self.XML_NS,
         root_tag=self.ROOT_TAG,
         child_tag=self.CHILD_TAG,
         actual_xml_base=self.actual_xml_base,
         **self.pool_attribute_kwargs)
     actual_obj = Pools.deserialize(actual_xml, 'xml')
     self.assertEqual(self.expected_obj, actual_obj)