Example #1
0
    def test_entrypoint_names(self):
        # Correct
        parser.from_JSON_string(TEST_JSON, "MonthlyOperatingReport")
        parser.from_XML_string(TEST_XML, "Appraisal")

        # Misspelled cases
        with self.assertRaises(Exception):
            parser.from_JSON_string(TEST_JSON, "MonlyOperatingReport")
        with self.assertRaises(Exception):
            parser.from_XML_string(TEST_XML, "Apprial")

        # Wrong entrypoint
        with self.assertRaises(Exception):
            parser.from_JSON_string(TEST_JSON, "CutSheet")
        with self.assertRaises(Exception):
            parser.from_XML_string(TEST_XML, "System")
Example #2
0
 def test_xml(self):
     entrypoint = parser.from_XML_string(TEST_XML)
     out = parser.to_XML_string(entrypoint)