def test_parse_file_which_contain_packages_info(self): testfile = open( "dojo/unittests/scans/twistlock/findings_include_packages.json") parser = TwistlockParser() findings = parser.get_findings(testfile, Test()) testfile.close() self.assertEqual(4, len(findings))
def test_parse_file_with_no_vuln(self): testfile = open( path.join(path.dirname(__file__), "../scans/twistlock/no_vuln.json")) parser = TwistlockParser() findings = parser.get_findings(testfile, Test()) testfile.close() self.assertEqual(0, len(findings))
def test_parse_file_which_contain_packages_info(self): testfile = open( path.join(path.dirname(__file__), "../scans/twistlock/findings_include_packages.json")) parser = TwistlockParser() findings = parser.get_findings(testfile, Test()) testfile.close() self.assertEqual(4, len(findings))
def test_parse_file_prisma_twistlock_images_long_package_name(self): testfile = open( "dojo/unittests/scans/twistlock/scan_report_prisma_twistlock_images_long_package_name.csv" ) parser = TwistlockParser() findings = parser.get_findings(testfile, Test()) testfile.close() self.assertEqual(1, len(findings))
def test_parse_file_prisma_twistlock_images_four_vulns(self): testfile = open( path.join(path.dirname(__file__), "../scans/twistlock/scan_report_prisma_twistlock_images_four_vulns.csv") ) parser = TwistlockParser() findings = parser.get_findings(testfile, Test()) testfile.close() self.assertEqual(4, len(findings))
def test_parse_file_with_no_vuln(self): testfile = open("dojo/unittests/scans/twistlock/no_vuln.json") parser = TwistlockParser() findings = parser.get_findings(testfile, Test()) testfile.close() self.assertEqual(0, len(findings))