def test_ptp_highest_ranking_info_vuln(self): my_ptp = PTP() my_ptp.vulns = [{ 'ranking': constants.UNKNOWN }, { 'ranking': constants.INFO }] self.assertTrue(my_ptp.highest_ranking == constants.INFO)
def test_ptp_get_highest_ranking_low_vuln(self): my_ptp = PTP() my_ptp.vulns = [{ 'ranking': constants.UNKNOWN }, { 'ranking': constants.INFO }, { 'ranking': constants.LOW }] self.assertTrue(my_ptp.get_highest_ranking() == constants.LOW)
def test_ptp_highest_ranking_medium_vuln(self): my_ptp = PTP() my_ptp.vulns = [{ 'ranking': constants.UNKNOWN }, { 'ranking': constants.INFO }, { 'ranking': constants.LOW }, { 'ranking': constants.MEDIUM }] self.assertTrue(my_ptp.highest_ranking == constants.MEDIUM)
def test_ptp_get_highest_ranking_info_vuln(self): my_ptp = PTP() my_ptp.vulns = [{'ranking': constants.UNKNOWN}, {'ranking': constants.INFO}] self.assertTrue(my_ptp.get_highest_ranking() == constants.INFO)
def test_ptp_get_highest_ranking_unknown_vuln(self): my_ptp = PTP() my_ptp.vulns = [{'ranking': constants.UNKNOWN}] self.assertTrue(my_ptp.get_highest_ranking() == constants.UNKNOWN)
def test_ptp_get_highest_ranking_vuln_with_no_ranking(self): my_ptp = PTP() my_ptp.vulns = [{'foo': 'bar'}] self.assertTrue(my_ptp.get_highest_ranking() == constants.UNKNOWN)
def test_ptp_highest_ranking_high_vuln(self): my_ptp = PTP() my_ptp.vulns = [ {'ranking': constants.UNKNOWN}, {'ranking': constants.INFO}, {'ranking': constants.LOW}, {'ranking': constants.MEDIUM}, {'ranking': constants.HIGH}] self.assertTrue(my_ptp.highest_ranking == constants.HIGH)
def test_ptp_get_highest_ranking_medium_vuln(self): my_ptp = PTP() my_ptp.vulns = [ {'ranking': constants.UNKNOWN}, {'ranking': constants.INFO}, {'ranking': constants.LOW}, {'ranking': constants.MEDIUM}] self.assertTrue(my_ptp.get_highest_ranking() == constants.MEDIUM)