def test_advisories_from_event_missing_all_errata(self, errata_http_get, errata_rest_get): mocked_errata = MockedErrataAPI(errata_rest_get, errata_http_get) del mocked_errata.builds["libntirpc-1.4.3-4.el7rhgs"]["all_errata"] event = BrewSignRPMEvent("msgid", "libntirpc-1.4.3-4.el7rhgs") advisories = self.errata.advisories_from_event(event) self.assertEqual(len(advisories), 0)
def test_advisories_from_event_no_bugs(self, errata_http_get, errata_rest_get): mocked_errata = MockedErrataAPI(errata_rest_get, errata_http_get) mocked_errata.bugs = [] event = BrewSignRPMEvent("msgid", "libntirpc-1.4.3-4.el7rhgs") advisories = self.errata.advisories_from_event(event) self.assertEqual(len(advisories), 1) self.assertEqual(advisories[0].has_hightouch_bug, False)
def test_advisories_from_event_empty_cve(self, errata_http_get, errata_rest_get): mocked_errata = MockedErrataAPI(errata_rest_get, errata_http_get) mocked_errata.advisory_rest_json["content"]["content"]["cve"] = "" event = BrewSignRPMEvent("msgid", "libntirpc-1.4.3-4.el7rhgs") advisories = self.errata.advisories_from_event(event) self.assertEqual(len(advisories), 1) self.assertEqual(advisories[0].cve_list, [])
def test_advisories_from_event(self, errata_http_get, errata_rest_get): MockedErrataAPI(errata_rest_get, errata_http_get) event = BrewSignRPMEvent("msgid", "libntirpc-1.4.3-4.el7rhgs") advisories = self.errata.advisories_from_event(event) self.assertEqual(len(advisories), 1) self.assertEqual(advisories[0].errata_id, 28484) self.assertEqual(advisories[0].name, "RHSA-2017:28484") self.assertEqual(advisories[0].state, "QE") self.assertEqual(advisories[0].content_types, ["rpm"]) self.assertEqual(advisories[0].security_impact, "important") self.assertEqual(advisories[0].product_short_name, "product") self.assertEqual(advisories[0].cve_list, ["CVE-2015-3253", "CVE-2016-6814"]) self.assertEqual(advisories[0].has_hightouch_bug, True)