Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split cloudformation unit test fix off from module_util migrations #50

Merged
merged 1 commit into from
May 13, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion tests/unit/modules/test_cloudformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import pytest

from ansible_collections.amazon.aws.tests.unit.utils.amazon_placebo_fixtures import placeboify, maybe_sleep
from ansible_collections.amazon.aws.plugins.module_utils.ec2 import boto_exception
from ansible_collections.amazon.aws.plugins.modules import cloudformation as cfn_module

basic_yaml_tpl = """
Expand Down Expand Up @@ -64,6 +65,11 @@ def fail_json(self, *args, **kwargs):
self.exit_kwargs = kwargs
raise Exception('FAIL')

def fail_json_aws(self, *args, **kwargs):
self.exit_args = args
self.exit_kwargs = kwargs
raise Exception('FAIL')

def exit_json(self, *args, **kwargs):
self.exit_args = args
self.exit_kwargs = kwargs
Expand All @@ -82,7 +88,7 @@ def test_invalid_template_json(placeboify):
pytest.fail('Expected malformed JSON to have caused the call to fail')

assert exc_info.match('FAIL')
assert "ValidationError" in m.exit_kwargs['msg']
assert "ValidationError" in boto_exception(m.exit_args[0])


def test_client_request_token_s3_stack(maybe_sleep, placeboify):
Expand Down