allow pytest to work from root or wait-for-ecr-scan-and-get-sarif
This commit is contained in:
parent
11e961b3d0
commit
b889ea329a
|
@ -1,9 +1,14 @@
|
||||||
import json
|
import json
|
||||||
import pytest
|
import pytest
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
|
||||||
from aws_scan_findings_to_sarif import convert_to_sarif
|
from aws_scan_findings_to_sarif import convert_to_sarif
|
||||||
|
|
||||||
def test_convert_to_sarif():
|
def test_convert_to_sarif():
|
||||||
with open("sample-api-response-ecr-describe-image-scan-findings.json", "r") as f:
|
base_dir = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
sample_file_path = os.path.join(base_dir, "sample-api-response-ecr-describe-image-scan-findings.json")
|
||||||
|
with open(sample_file_path, "r") as f:
|
||||||
ecr_response = json.load(f)
|
ecr_response = json.load(f)
|
||||||
|
|
||||||
sarif_report = convert_to_sarif(ecr_response)
|
sarif_report = convert_to_sarif(ecr_response)
|
||||||
|
|
Loading…
Reference in New Issue