def validate_result(self, test, result, traceback=""):
"""Validate adding result gives the expected output.
Args:
test (rotest.core.case.TestCase): the test its result was added.
result (str): result to add to the test.
traceback (str): the traceback of the test.
Raises:
AssertionError. the result wasn't added as expected.
"""
if isinstance(test, TestBlock):
return
result_xml_file = os.path.join(test.work_dir,
XMLHandler.XML_REPORT_PATH)
expected_xml_file = self.expected_xml_files.next()
expected_xml = xmltodict.parse(open(expected_xml_file, "rt").read(),
dict_constructor=dict)
result_xml = xmltodict.parse(open(result_xml_file, "rt").read(),
dict_constructor=dict)
self.assertEqual(expected_xml, result_xml)
评论列表
文章目录