chore(outputs): raise an error when using -M asff for a provider other than aws (#9225)

This commit is contained in:
Hugo Pereira Brito
2025-11-13 16:53:22 +01:00
committed by GitHub
parent d1380fc19d
commit 866edfb167
6 changed files with 45 additions and 4 deletions
+17
View File
@@ -1235,6 +1235,23 @@ class Test_Parser:
== f"{prowler_default_usage_error}\nprowler: error: unrecognized arguments: --subscription-ids\n"
)
def test_parser_non_aws_with_json_asff_output(self, capsys):
command = [
prowler_command,
"azure",
"--sp-env-auth",
"--output-formats",
"json-asff",
]
with pytest.raises(SystemExit) as wrapped_exit:
_ = self.parser.parse(command)
assert wrapped_exit.type == SystemExit
assert wrapped_exit.value.code == 2
assert (
capsys.readouterr().err
== f"{prowler_default_usage_error}\nprowler: error: json-asff output format is only available for the aws provider, but azure was selected\n"
)
def test_parser_gcp_auth_credentials_file(self):
argument = "--credentials-file"
file = "test.json"