def test_to_json(self): source = ValueList.parse(PythonDocumentBuilder, json.loads(self.json_file)) json_raw = ValueList.build(PythonDocumentBuilder, source) value_list = ValueList.parse(PythonDocumentBuilder, json_raw) self.assertEqual(value_list.total, 55)
def test_to_xml(self): source_node = etree.XML(self.xml_file) source = ValueList.parse(LXMLDocumentBuilder, source_node) xml_node = ValueList.build(LXMLDocumentBuilder, source) value_list = ValueList.parse(LXMLDocumentBuilder, xml_node) self.assertEqual(value_list.total, 55)