mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-10-09 21:14:22 +00:00
Merge branch 'PRWLR-7300-create-ia-c-provider' into PRWLR-7318-add-ia-c-provider-tests
This commit is contained in:
@@ -162,9 +162,7 @@ class IacProvider(Provider):
|
||||
|
||||
# Log Checkov's error output if any
|
||||
if process.stderr:
|
||||
logger.critical(
|
||||
f"{process.stderr.__class__.__name__} -- {process.stderr}"
|
||||
)
|
||||
logger.critical(process.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
from prowler.lib.check.models import CheckReportIAC
|
||||
from prowler.providers.iac.iac_provider import IacProvider
|
||||
from tests.providers.iac.iac_fixtures import (
|
||||
@@ -113,9 +115,10 @@ class TestIacProvider:
|
||||
stdout=get_invalid_checkov_output(), stderr=""
|
||||
)
|
||||
|
||||
reports = provider.run_scan("/test/directory")
|
||||
with pytest.raises(SystemExit) as excinfo:
|
||||
provider.run_scan("/test/directory")
|
||||
|
||||
assert len(reports) == 0
|
||||
assert excinfo.value.code == 1
|
||||
|
||||
@patch("subprocess.run")
|
||||
def test_iac_provider_run_scan_null_output(self, mock_subprocess):
|
||||
|
||||
Reference in New Issue
Block a user