Example #1
0
 def test_multipleEnums_areEnumsReadCorrectly(self):
     xml_doc = ET.fromstring(self.xmlMultipleEnums)
     parsed_doc = structureparser.global_enums(xml_doc)
     self.assertEqual(parsed_doc[0]["values"][0]["name"], "Maybe_is_Enough")
     self.assertEqual(parsed_doc[1]["values"][0]["id"], 0x200)
Example #2
0
 def test_singleEnum_areEnumsReadCorrectly(self):
     xml_doc = ET.fromstring(self.xmlSingleEnum)
     enum_ast = structureparser.global_enums(xml_doc)[0]["values"][-1]
     self.assertEqual(enum_ast["id"], 300)
     self.assertEqual(enum_ast["name"], "Warmongers")
Example #3
0
 def test_multipleEnums(self):
     xml_doc = ET.fromstring(self.xmlMultipleEnums)
     parsed_doc = structureparser.global_enums(xml_doc)
     self.assertEqual(len(parsed_doc), 2)
     self.assertEqual(parsed_doc[0]["name"], "messageid_enum_multi")
     self.assertEqual(parsed_doc[1]["name"], "messageid_enum_2")
Example #4
0
 def test_noEnums(self):
     xml_doc = ET.fromstring(self.noEnums)
     parsed_doc = structureparser.global_enums(xml_doc)
     self.assertEqual(len(parsed_doc), 0)
Example #5
0
 def test_singleEnum(self):
     xml_doc = ET.fromstring(self.xmlSingleEnum)
     parsed_doc = structureparser.global_enums(xml_doc)
     self.assertEqual(len(parsed_doc), 1)
     self.assertEqual(parsed_doc[0]["name"], "messageid_enum")
 def test_multipleEnums_areEnumsReadCorrectly(self):
     xml_doc = ET.fromstring(self.xmlMultipleEnums)
     parsed_doc = structureparser.global_enums(xml_doc)
     self.assertEqual(parsed_doc[0]["values"][0]["name"], "Maybe_is_Enough")
     self.assertEqual(parsed_doc[1]["values"][0]["id"], 0x200)
 def test_multipleEnums(self):
     xml_doc = ET.fromstring(self.xmlMultipleEnums)
     parsed_doc = structureparser.global_enums(xml_doc)
     self.assertEqual(len(parsed_doc), 2)
     self.assertEqual(parsed_doc[0]["name"], "messageid_enum_multi")
     self.assertEqual(parsed_doc[1]["name"], "messageid_enum_2")
 def test_singleEnum_areEnumsReadCorrectly(self):
     xml_doc = ET.fromstring(self.xmlSingleEnum)
     enum_ast = structureparser.global_enums(xml_doc)[0]["values"][-1]
     self.assertEqual(enum_ast["id"], 300)
     self.assertEqual(enum_ast["name"], "Warmongers")
 def test_singleEnum(self):
     xml_doc = ET.fromstring(self.xmlSingleEnum)
     parsed_doc = structureparser.global_enums(xml_doc)
     self.assertEqual(len(parsed_doc), 1)
     self.assertEqual(parsed_doc[0]["name"], "messageid_enum")
 def test_noEnums(self):
     xml_doc = ET.fromstring(self.noEnums)
     parsed_doc = structureparser.global_enums(xml_doc)
     self.assertEqual(len(parsed_doc), 0)