def test_bad_version(self): """ Test a csv file with a bad version column (should fail) """ output = csv2cve(os.path.join(self.CSV_PATH, "bad_version.csv")) self.assertEqual(-2, output)
def test_sample_csv(self): output = csv2cve(os.path.join(self.CSV_PATH, "test.csv")) self.assertIn("CVE-2018-19664", output[0]) self.assertIn("CVE-2018-0500", output[1]) self.assertIn("CVE-2018-1000300", output[1]) self.assertIn("CVE-2018-14618", output[2])
def test_bad_csv(self): """ Test a empty csv file (should fail) """ output = csv2cve(os.path.join(self.CSV_PATH, "bad.csv")) self.assertEqual(-1, output)
def test_bad_package(self): """ Test a csv file with a bad product column (should fail) """ output = csv2cve(os.path.join(self.CSV_PATH, "bad_product.csv")) self.assertEqual(-2, output)
def test_bad_version(self): output = csv2cve(os.path.join(self.CSV_PATH, "bad_version.csv")) self.assertEqual(-2, output)
def test_bad_package(self): output = csv2cve(os.path.join(self.CSV_PATH, "bad_package.csv")) self.assertEqual(-2, output)
def test_bad_csv(self): output = csv2cve(os.path.join(self.CSV_PATH, "bad.csv")) self.assertEqual(-1, output)