9
9
class TestAcunetixParser (DojoTestCase ):
10
10
11
11
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 :
13
13
parser = AcunetixParser ()
14
14
findings = parser .get_findings (testfile , Test ())
15
15
for finding in findings :
@@ -37,7 +37,7 @@ def test_parse_file_with_one_finding(self):
37
37
self .assertEqual ("some/path" , endpoint .path )
38
38
39
39
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 :
41
41
parser = AcunetixParser ()
42
42
findings = parser .get_findings (testfile , Test ())
43
43
for finding in findings :
@@ -132,7 +132,7 @@ def test_parse_file_with_multiple_finding(self):
132
132
self .assertIsInstance (req_resp ["resp" ], str )
133
133
134
134
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 :
136
136
parser = AcunetixParser ()
137
137
findings = parser .get_findings (testfile , Test ())
138
138
for finding in findings :
@@ -204,7 +204,7 @@ def test_parse_file_with_example_com(self):
204
204
self .assertIsInstance (req_resp ["resp" ], str )
205
205
206
206
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 :
208
208
parser = AcunetixParser ()
209
209
findings = parser .get_findings (testfile , Test ())
210
210
self .assertEqual (1 , len (findings ))
@@ -225,7 +225,7 @@ def test_parse_file_with_one_finding_acunetix360(self):
225
225
self .assertIn ("https://online.acunetix360.com/issues/detail/735f4503-e9eb-4b4c-4306-ad49020a4c4b" , finding .references )
226
226
227
227
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 :
229
229
parser = AcunetixParser ()
230
230
findings = parser .get_findings (testfile , Test ())
231
231
self .assertEqual (1 , len (findings ))
@@ -245,7 +245,7 @@ def test_parse_file_with_one_finding_false_positive(self):
245
245
self .assertTrue (finding .false_p )
246
246
247
247
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 :
249
249
parser = AcunetixParser ()
250
250
findings = parser .get_findings (testfile , Test ())
251
251
self .assertEqual (1 , len (findings ))
@@ -265,7 +265,7 @@ def test_parse_file_with_one_finding_risk_accepted(self):
265
265
self .assertTrue (finding .risk_accepted )
266
266
267
267
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 :
269
269
parser = AcunetixParser ()
270
270
findings = parser .get_findings (testfile , Test ())
271
271
self .assertEqual (16 , len (findings ))
@@ -306,7 +306,7 @@ def test_parse_file_with_multiple_finding_acunetix360(self):
306
306
self .assertEqual (str (endpoint ), "http://php.testsparker.com" )
307
307
308
308
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 :
310
310
parser = AcunetixParser ()
311
311
findings = parser .get_findings (testfile , Test ())
312
312
self .assertEqual (1 , len (findings ))
@@ -325,19 +325,19 @@ def test_parse_file_with_mulitple_cwe(self):
325
325
self .assertEqual (str (endpoint ), "http://php.testsparker.com/auth/login.php" )
326
326
327
327
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 :
329
329
parser = AcunetixParser ()
330
330
findings = parser .get_findings (testfile , Test ())
331
331
self .assertEqual (1 , len (findings ))
332
332
333
333
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 :
335
335
parser = AcunetixParser ()
336
336
findings = parser .get_findings (testfile , Test ())
337
337
self .assertEqual (1 , len (findings ))
338
338
339
339
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 :
341
341
parser = AcunetixParser ()
342
342
findings = parser .get_findings (testfile , Test ())
343
343
self .assertEqual (1 , len (findings ))
0 commit comments