def test_parse_invalid_bug_details(self): """Test whether it fails parsing an invalid XML with no bugs""" raw_xml = read_file('data/bugzilla/bugzilla_bugs_details_not_valid.xml') with self.assertRaises(ParseError): bugs = Bugzilla.parse_bugs_details(raw_xml) _ = [bug for bug in bugs]
def test_parse_bugs_details(self): """Test bugs details parsing""" raw_xml = read_file('data/bugzilla/bugzilla_bugs_details.xml') bugs = Bugzilla.parse_bugs_details(raw_xml) result = [bug for bug in bugs] self.assertEqual(len(result), 5) bug_ids = [bug['bug_id'][0]['__text__'] for bug in result] expected = ['15', '18', '17', '20', '19'] self.assertListEqual(bug_ids, expected) raw_xml = read_file('data/bugzilla/bugzilla_bugs_details_next.xml') bugs = Bugzilla.parse_bugs_details(raw_xml) result = [bug for bug in bugs]