mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-23 20:42:02 +00:00
fix(set_report_color): Add more details to error (#6751)
This commit is contained in:
@@ -83,7 +83,9 @@ def set_report_color(status: str, muted: bool = False) -> str:
|
||||
elif status == "MANUAL":
|
||||
color = Fore.YELLOW
|
||||
else:
|
||||
raise Exception("Invalid Report Status. Must be PASS, FAIL or MANUAL.")
|
||||
raise Exception(
|
||||
f"Invalid Report Status: {status}. Must be PASS, FAIL or MANUAL."
|
||||
)
|
||||
return color
|
||||
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ from prowler.lib.outputs.utils import (
|
||||
|
||||
|
||||
class TestOutputs:
|
||||
|
||||
def test_set_report_color(self):
|
||||
test_status = ["PASS", "FAIL", "MANUAL"]
|
||||
test_colors = [Fore.GREEN, Fore.RED, Fore.YELLOW]
|
||||
@@ -35,8 +34,9 @@ class TestOutputs:
|
||||
with pytest.raises(Exception) as exc:
|
||||
set_report_color(test_status)
|
||||
|
||||
assert "Invalid Report Status. Must be PASS, FAIL or MANUAL" in str(exc.value)
|
||||
assert exc.type == Exception
|
||||
assert "Invalid Report Status: INVALID. Must be PASS, FAIL or MANUAL" in str(
|
||||
exc.value
|
||||
)
|
||||
|
||||
def test_unroll_list_no_separator(self):
|
||||
list = ["test", "test1", "test2"]
|
||||
|
||||
Reference in New Issue
Block a user