mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-10-09 21:14:22 +00:00
chore(outputs): raise an error when using -M asff for a provider other than aws (#9225)
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user