forked from ioggstream/bandit-report-artifacts
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from par-tec/ioggstream-18
Fix: #18. Refactoring severity mapping functions
- Loading branch information
Showing
8 changed files
with
64 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import json | ||
|
||
|
||
def json_load(fpath): | ||
return json.loads(fpath.read_text()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import json | ||
from pathlib import Path | ||
|
||
from parse_scripts import checkov | ||
from parse_scripts.util import json_load | ||
|
||
TEST_DIR = Path(__file__).parent | ||
JSON_DIR = TEST_DIR / "json" | ||
DATA_DIR = TEST_DIR / "data" | ||
|
||
|
||
def test_checkov_parse(): | ||
expected_comments = json.loads((TEST_DIR / "data/checkov_input.json").read_text()) | ||
with open(JSON_DIR / "checkov.json", "r") as fd: | ||
data = json.load(fd) | ||
def test_parse(): | ||
expected_comments = json_load(DATA_DIR / "checkov_input.json") | ||
data = json_load(JSON_DIR / "checkov.json") | ||
actual_comments = checkov.checkov_results(log=data, github_sha="stuff") | ||
actual_comments["completed_at"] = "00:00" | ||
assert expected_comments == actual_comments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters