Skip to content

Commit

Permalink
Merge branch 'main' into secureli-265-python311-support
Browse files Browse the repository at this point in the history
  • Loading branch information
RobMRodriguez authored Oct 10, 2023
2 parents 10deada + c1fafe4 commit e1fb40f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Like this:
`chore: my PR title`

Valid prefixes are defined in the [angular documentation](https://github.com/angular/angular/blob/main/CONTRIBUTING.md#commit)
_Important: Use "feat" to have a release automatically published. "fix,perf,docs,chore,chore(release)" only creates a patch
version which does not get automatically released._

# Environment Requirements

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "secureli"
version = "0.14.0"
version = "0.15.0"
description = "Secure Project Manager"
authors = ["Caleb Tonn <[email protected]>"]
license = "Apache-2.0"
Expand Down
2 changes: 2 additions & 0 deletions secureli/actions/scan.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
import sys
from pathlib import Path
from typing import Optional

Expand Down Expand Up @@ -78,6 +79,7 @@ def scan_repo(
)

post_log(log_data.json(exclude_none=True))
sys.exit("Issues Found...Aborting")
else:
self.echo.print("Scan executed successfully and detected no issues!")
log_data = self.logging.success(LogAction.scan)
Expand Down
26 changes: 13 additions & 13 deletions tests/actions/test_scan_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,19 +108,19 @@ def scan_action(
)


@mock.patch.dict(os.environ, {"API_KEY": "", "API_ENDPOINT": ""}, clear=True)
def test_that_scan_repo_errors_if_not_successful(
scan_action: ScanAction,
mock_scanner: MagicMock,
mock_echo: MagicMock,
):
mock_scanner.scan_repo.return_value = ScanResult(
successful=False, output="Bad Error", failures=[]
)

scan_action.scan_repo(test_folder_path, ScanMode.STAGED_ONLY, False)

mock_echo.print.assert_called_with("Bad Error")
# @mock.patch.dict(os.environ, {"API_KEY": "", "API_ENDPOINT": ""}, clear=True)
# def test_that_scan_repo_errors_if_not_successful(
# scan_action: ScanAction,
# mock_scanner: MagicMock,
# mock_echo: MagicMock,
# ):
# mock_scanner.scan_repo.return_value = ScanResult(
# successful=False, output="Bad Error", failures=[]
# )
#
# scan_action.scan_repo(test_folder_path, ScanMode.STAGED_ONLY, False)
#
# mock_echo.print.assert_called_with("Bad Error")


@mock.patch.dict(os.environ, {"API_KEY": "", "API_ENDPOINT": ""}, clear=True)
Expand Down

0 comments on commit e1fb40f

Please sign in to comment.