def buildSummaryXML(self, index_list): summary_dom = Document() gip = addChild(summary_dom, summary_dom, "gip") status = 0 addChild(summary_dom, gip, "TestRunTime", index_list[0]["TestRunTime"]) for item in index_list: resource = addChild(summary_dom, gip, "Resource") addChild(summary_dom, resource, "Name", item["Name"]) for case in item["TestCases"]: if case["Name"] in self.oim_tests: testCase = addChild(summary_dom, resource, "TestCase") addChild(summary_dom, testCase, "Name", case["Name"]) addChild(summary_dom, testCase, "Status", case["Status"]) addChild(summary_dom, testCase, "Reason") if not case["Status"] == "OK": status += 1 if status > 0: OverAllStatus = "FAIL" else: OverAllStatus = "OK" addChild(summary_dom, resource, "OverAllStatus", OverAllStatus) status = 0 writeXML(summary_dom, self.oim_summary_xml_file)
def buildResourceXML(self, results_list): for resource in results_list: resource_dom = Document() gip = addChild(resource_dom, resource_dom, "gip") addChild(resource_dom, gip, "TestRunTime", self.test_run_time) addChild(resource_dom, gip, "ResourceName", resource["Name"]) for case in resource["TestCases"]: if case["Name"] in self.oim_tests: testCase = addChild(resource_dom, gip, "TestCase") addChild(resource_dom, testCase, "Name", case["Name"]) addChild(resource_dom, testCase, "Status", case["Status"]) for detail in case["Details"]: addChild(resource_dom, testCase, "Detail", detail) writeXML(resource_dom, self.oim_detail_file_template % resource["Name"])