Exemplo n.º 1
0
 def test_to_json(self):
     company = Company.parse(PythonDocumentBuilder,
                             json.loads(self.json_file))
     raw_dict = company.build(PythonDocumentBuilder, company)
     raw_json = json.dumps(raw_dict)
     source = Company.parse(PythonDocumentBuilder, json.loads(raw_json))
     self.assert_user(source.ceo)
Exemplo n.º 2
0
 def test_to_xml(self):
     source_node = etree.XML(self.xml_file)
     company = Company.parse(LXMLDocumentBuilder, source_node)
     xml_node = company.build(LXMLDocumentBuilder, company)
     source = Company.parse(LXMLDocumentBuilder, xml_node)
     self.assert_user(source.ceo)
Exemplo n.º 3
0
 def test_from_json(self):
     company = Company.parse(PythonDocumentBuilder,
                             json.loads(self.json_file))
     self.assert_user(company.ceo)
Exemplo n.º 4
0
 def test_from_xml(self):
     node = etree.XML(self.xml_file)
     company = Company.parse(LXMLDocumentBuilder, node)
     self.assert_user(company.ceo)