|
1 | 1 | import copy
|
2 | 2 | import json
|
3 | 3 | import logging
|
4 |
| -import os |
5 | 4 | from functools import wraps
|
6 | 5 | from itertools import chain
|
7 | 6 | from pathlib import Path
|
|
40 | 39 |
|
41 | 40 |
|
42 | 41 | def get_unit_tests_path():
|
43 |
| - return str(Path(os.path.realpath(__file__)).parent) |
| 42 | + return Path(__file__).parent |
44 | 43 |
|
45 | 44 |
|
46 | 45 | def toggle_system_setting_boolean(flag_name, value):
|
@@ -504,7 +503,7 @@ def import_scan_with_params(self, filename, scan_type="ZAP Scan", engagement=1,
|
504 | 503 | product_name=None, product_type_name=None, auto_create_context=None, expected_http_status_code=201, test_title=None,
|
505 | 504 | scan_date=None, service=None, forceActive=True, forceVerified=True):
|
506 | 505 |
|
507 |
| - with open(get_unit_tests_path() + "/" + filename, encoding="utf-8") as testfile: |
| 506 | + with open(get_unit_tests_path() / filename, encoding="utf-8") as testfile: |
508 | 507 | payload = {
|
509 | 508 | "minimum_severity": minimum_severity,
|
510 | 509 | "active": active,
|
@@ -556,7 +555,7 @@ def import_scan_with_params(self, filename, scan_type="ZAP Scan", engagement=1,
|
556 | 555 | def reimport_scan_with_params(self, test_id, filename, scan_type="ZAP Scan", engagement=1, minimum_severity="Low", active=True, verified=False, push_to_jira=None,
|
557 | 556 | tags=None, close_old_findings=True, group_by=None, engagement_name=None, scan_date=None,
|
558 | 557 | product_name=None, product_type_name=None, auto_create_context=None, expected_http_status_code=201, test_title=None):
|
559 |
| - with open(get_unit_tests_path() + "/" + filename, encoding="utf-8") as testfile: |
| 558 | + with open(get_unit_tests_path() / filename, encoding="utf-8") as testfile: |
560 | 559 | payload = {
|
561 | 560 | "minimum_severity": minimum_severity,
|
562 | 561 | "active": active,
|
@@ -605,7 +604,7 @@ def reimport_scan_with_params(self, test_id, filename, scan_type="ZAP Scan", eng
|
605 | 604 | def endpoint_meta_import_scan_with_params(self, filename, product=1, product_name=None,
|
606 | 605 | create_endpoints=True, create_tags=True, create_dojo_meta=True,
|
607 | 606 | expected_http_status_code=201):
|
608 |
| - with open(get_unit_tests_path() + "/" + filename, encoding="utf-8") as testfile: |
| 607 | + with open(get_unit_tests_path() / filename, encoding="utf-8") as testfile: |
609 | 608 | payload = {
|
610 | 609 | "create_endpoints": create_endpoints,
|
611 | 610 | "create_tags": create_tags,
|
|
0 commit comments