def test_can_lower_case_should_be_ok(self): cve_str = "can-2011-0346" self.assertTrue(CVEID.correct_cve_str(cve_str)) cve = CVEID(cve_str) self.assertEqual(cve.get_year(), 2011) self.assertEqual(cve.is_candidate(), True) self.assertEqual(str(cve), cve_str)
def test_can_should_be_bad_name_2(self): cve_str = "CANN-2011-0346" self.assertFalse(CVEID.correct_cve_str(cve_str)) self.assertRaises(ValueError, CVEID, cve_str)
def test_cve_should_be_bad_number(self): cve_str = "CVE-20110346" self.assertFalse(CVEID.correct_cve_str(cve_str)) self.assertRaises(ValueError, CVEID, cve_str)