def parse_results(results_xml, insignificant_tests_matter): """ @type results_xml: C{str} @param results_xml: The results xml @type insignificant_tests_matter: C{bool} @param insignificant_tests_matter: Flag @rtype: C{list} of C{TestrunResult} @return: A list of the Test results that matter Parse the Test results xml """ validate_xml(results_xml) visitor = ElementTreeVisitor() processor = SignificantResultsProcessor(insignificant_tests_matter) visitor.add_processor(processor) root = ElementTree.fromstring(results_xml) visitor.visit(root) return processor.all_passed
def test_validate_xml(self): dirname = os.path.dirname(os.path.abspath(__file__)) results_file = os.path.join(dirname, "data", "dummy_results_file.xml") results_xml = open(results_file, "r").read() validate_xml(results_xml)