Exemplo n.º 1
0
    def test_aqua_parser_cvssv3_has_many_findings(self):
        with open("dojo/unittests/scans/aqua/many_vulns.json") as testfile:
            parser = AquaParser()
            findings = parser.get_findings(testfile, Test())
            nb_cvssv3 = 0
            for finding in findings:
                if finding.cvssv3 is not None:
                    nb_cvssv3 = nb_cvssv3 + 1

            self.assertEqual(16, nb_cvssv3)
Exemplo n.º 2
0
    def test_aqua_parser_for_aqua_severity(self):
        with open("dojo/unittests/scans/aqua/vulns_with_aqua_severity.json"
                  ) as testfile:
            parser = AquaParser()
            findings = parser.get_findings(testfile, Test())
            sevs = list()

            for finding in findings:
                sevs.append(finding.severity)

            d = Counter(sevs)
            self.assertEqual(1, d['Critical'])
            self.assertEqual(1, d['High'])
            self.assertEqual(2, d['Medium'])
            self.assertEqual(2, d['Low'])
            self.assertEqual(7, d['Info'])
Exemplo n.º 3
0
 def test_aqua_parser_has_no_finding(self):
     testfile = open("dojo/unittests/scans/aqua/no_vuln.json")
     parser = AquaParser()
     findings = parser.get_findings(testfile, Test())
     self.assertEqual(0, len(findings))
Exemplo n.º 4
0
 def test_aqua_parser_v2_has_many_findings(self):
     with open("dojo/unittests/scans/aqua/many_v2.json") as testfile:
         parser = AquaParser()
         findings = parser.get_findings(testfile, Test())
         self.assertEqual(3, len(findings))
Exemplo n.º 5
0
 def test_aqua_parser_has_many_findings(self):
     testfile = open("dojo/unittests/scans/aqua/many_vulns.json")
     parser = AquaParser()
     findings = parser.get_findings(testfile, Test())
     testfile.close()
     self.assertEqual(24, len(findings))
Exemplo n.º 6
0
 def test_aqua_parser_v2_has_one_finding(self):
     with open("unittests/scans/aqua/one_v2.json") as testfile:
         parser = AquaParser()
         findings = parser.get_findings(testfile, Test())
         self.assertEqual(1, len(findings))
Exemplo n.º 7
0
 def test_aqua_parser_has_one_finding(self):
     testfile = open("unittests/scans/aqua/one_vuln.json")
     parser = AquaParser()
     findings = parser.get_findings(testfile, Test())
     testfile.close()
     self.assertEqual(1, len(findings))