99class TestAcunetixParser (DojoTestCase ):
1010
1111 def test_parse_file_with_one_finding (self ):
12- with open (get_unit_tests_scans_path ("acunetix" ) / "one_finding.xml" , encoding = "utf-8" ) as testfile :
12+ with (get_unit_tests_scans_path ("acunetix" ) / "one_finding.xml" ). open ( encoding = "utf-8" ) as testfile :
1313 parser = AcunetixParser ()
1414 findings = parser .get_findings (testfile , Test ())
1515 for finding in findings :
@@ -37,7 +37,7 @@ def test_parse_file_with_one_finding(self):
3737 self .assertEqual ("some/path" , endpoint .path )
3838
3939 def test_parse_file_with_multiple_finding (self ):
40- with open (get_unit_tests_scans_path ("acunetix" ) / "many_findings.xml" , encoding = "utf-8" ) as testfile :
40+ with (get_unit_tests_scans_path ("acunetix" ) / "many_findings.xml" ). open ( encoding = "utf-8" ) as testfile :
4141 parser = AcunetixParser ()
4242 findings = parser .get_findings (testfile , Test ())
4343 for finding in findings :
@@ -132,7 +132,7 @@ def test_parse_file_with_multiple_finding(self):
132132 self .assertIsInstance (req_resp ["resp" ], str )
133133
134134 def test_parse_file_with_example_com (self ):
135- with open (get_unit_tests_scans_path ("acunetix" ) / "XML_http_example_co_id_.xml" , encoding = "utf-8" ) as testfile :
135+ with (get_unit_tests_scans_path ("acunetix" ) / "XML_http_example_co_id_.xml" ). open ( encoding = "utf-8" ) as testfile :
136136 parser = AcunetixParser ()
137137 findings = parser .get_findings (testfile , Test ())
138138 for finding in findings :
@@ -204,7 +204,7 @@ def test_parse_file_with_example_com(self):
204204 self .assertIsInstance (req_resp ["resp" ], str )
205205
206206 def test_parse_file_with_one_finding_acunetix360 (self ):
207- with open (get_unit_tests_scans_path ("acunetix" ) / "acunetix360_one_finding.json" , encoding = "utf-8" ) as testfile :
207+ with (get_unit_tests_scans_path ("acunetix" ) / "acunetix360_one_finding.json" ). open ( encoding = "utf-8" ) as testfile :
208208 parser = AcunetixParser ()
209209 findings = parser .get_findings (testfile , Test ())
210210 self .assertEqual (1 , len (findings ))
@@ -225,7 +225,7 @@ def test_parse_file_with_one_finding_acunetix360(self):
225225 self .assertIn ("https://online.acunetix360.com/issues/detail/735f4503-e9eb-4b4c-4306-ad49020a4c4b" , finding .references )
226226
227227 def test_parse_file_with_one_finding_false_positive (self ):
228- with open (get_unit_tests_scans_path ("acunetix" ) / "acunetix360_one_finding_false_positive.json" , encoding = "utf-8" ) as testfile :
228+ with (get_unit_tests_scans_path ("acunetix" ) / "acunetix360_one_finding_false_positive.json" ). open ( encoding = "utf-8" ) as testfile :
229229 parser = AcunetixParser ()
230230 findings = parser .get_findings (testfile , Test ())
231231 self .assertEqual (1 , len (findings ))
@@ -245,7 +245,7 @@ def test_parse_file_with_one_finding_false_positive(self):
245245 self .assertTrue (finding .false_p )
246246
247247 def test_parse_file_with_one_finding_risk_accepted (self ):
248- with open (get_unit_tests_scans_path ("acunetix" ) / "acunetix360_one_finding_accepted_risk.json" , encoding = "utf-8" ) as testfile :
248+ with (get_unit_tests_scans_path ("acunetix" ) / "acunetix360_one_finding_accepted_risk.json" ). open ( encoding = "utf-8" ) as testfile :
249249 parser = AcunetixParser ()
250250 findings = parser .get_findings (testfile , Test ())
251251 self .assertEqual (1 , len (findings ))
@@ -265,7 +265,7 @@ def test_parse_file_with_one_finding_risk_accepted(self):
265265 self .assertTrue (finding .risk_accepted )
266266
267267 def test_parse_file_with_multiple_finding_acunetix360 (self ):
268- with open (get_unit_tests_scans_path ("acunetix" ) / "acunetix360_many_findings.json" , encoding = "utf-8" ) as testfile :
268+ with (get_unit_tests_scans_path ("acunetix" ) / "acunetix360_many_findings.json" ). open ( encoding = "utf-8" ) as testfile :
269269 parser = AcunetixParser ()
270270 findings = parser .get_findings (testfile , Test ())
271271 self .assertEqual (16 , len (findings ))
@@ -306,7 +306,7 @@ def test_parse_file_with_multiple_finding_acunetix360(self):
306306 self .assertEqual (str (endpoint ), "http://php.testsparker.com" )
307307
308308 def test_parse_file_with_mulitple_cwe (self ):
309- with open (get_unit_tests_scans_path ("acunetix" ) / "acunetix360_multiple_cwe.json" , encoding = "utf-8" ) as testfile :
309+ with (get_unit_tests_scans_path ("acunetix" ) / "acunetix360_multiple_cwe.json" ). open ( encoding = "utf-8" ) as testfile :
310310 parser = AcunetixParser ()
311311 findings = parser .get_findings (testfile , Test ())
312312 self .assertEqual (1 , len (findings ))
@@ -325,19 +325,19 @@ def test_parse_file_with_mulitple_cwe(self):
325325 self .assertEqual (str (endpoint ), "http://php.testsparker.com/auth/login.php" )
326326
327327 def test_parse_file_issue_10370 (self ):
328- with open (get_unit_tests_scans_path ("acunetix" ) / "issue_10370.json" , encoding = "utf-8" ) as testfile :
328+ with (get_unit_tests_scans_path ("acunetix" ) / "issue_10370.json" ). open ( encoding = "utf-8" ) as testfile :
329329 parser = AcunetixParser ()
330330 findings = parser .get_findings (testfile , Test ())
331331 self .assertEqual (1 , len (findings ))
332332
333333 def test_parse_file_issue_10435 (self ):
334- with open (get_unit_tests_scans_path ("acunetix" ) / "issue_10435.json" , encoding = "utf-8" ) as testfile :
334+ with (get_unit_tests_scans_path ("acunetix" ) / "issue_10435.json" ). open ( encoding = "utf-8" ) as testfile :
335335 parser = AcunetixParser ()
336336 findings = parser .get_findings (testfile , Test ())
337337 self .assertEqual (1 , len (findings ))
338338
339339 def test_parse_file_issue_11206 (self ):
340- with open (get_unit_tests_scans_path ("acunetix" ) / "issue_11206.json" , encoding = "utf-8" ) as testfile :
340+ with (get_unit_tests_scans_path ("acunetix" ) / "issue_11206.json" ). open ( encoding = "utf-8" ) as testfile :
341341 parser = AcunetixParser ()
342342 findings = parser .get_findings (testfile , Test ())
343343 self .assertEqual (1 , len (findings ))
0 commit comments