Update sys.path.appends to use Path object
Background
To remain consistent with how we gather parent directories in other contexts, we should update sys.path.append to use a Path object to get parent directories where needed (e.g. for test_*
files to import the module they're testing).
Example:
import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
should be
import sys
from pathlib import Path
sys.path.append(Path(__file__).absolute().parents[1])))
Acceptance Criteria
-
All sys.path.append
s use a Path object instead of os-
test_pipeline_csv_gen.py -
test_downloader.py -
test_base_image_validation.py -
test_dockerfile_validation.py -
test_folder_structure.py -
test_hardening_manifest_validation.py -
test_pipeline_auth_status.py -
test_upload_artifacts.py -
test_image_verify.py -
test_scan_logic_jobs.py -
test_trufflehog.py
-
Definition of Done
-
Write or update any unit or integration tests -
Project pipeline runs successfully -
Solution is captured as code and/or documentation and merge requests have been submitted -
Code review completed and merge request approved/merged -
All Acceptance Criteria have been completed
Edited by Michael Johnson