Commit Graph

11 Commits (1f733e2d5578eef10eee0525c92bf688ed23e9c6)

Author SHA1 Message Date
Andrey Klychkov 21863d48f3 unit tests: remove unused imports (#60462) 5 years ago
Toshio Kuratomi 87601969a3 Correct places where match was intended
pytest.raises has two parameters, message and match.  message is meant
to be the error message that pytest gives when the tested code does not
raise the expected exception.  match is the string that pytest expects
to be a match for the repr of the exception.  Unfortunately, it seems
that message is often mistakenly used where match is meant.  Fix those
cases.

message is also deprecated so removed our usage of it.  Perhaps we
should write a sanity test later that prevents the use of
pytest.raises(message) to avoid this mistake.

seealso: https://docs.pytest.org/en/4.6-maintenance/deprecations.html#message-parameter-of-pytest-raises

Also update the exception message tested for as we're now properly
detecting that the messages have changed.
5 years ago
Nathan Dines 5eb3117822 Added the OnFailure option to the AWS CloudFormation module (#52431)
* Added the OnFailure option to the AWS CloudFormation module

* Added unit tests for CloudFormation `on_create_failure`
6 years ago
Sloane Hertel 2167ce6cb6
Remove placeboify from unit tests that are not calling AWS (i.e. creating a recording) (#45754) 6 years ago
Dennis Benkert 28d0a173db [aws] add limit on number of CloudFormation stack events fetched by cloudformation module (#41840)
* Add a module parameter to configure the max fetched AWS CFN stack events
* Add version documentation for new configuration option
* Increase default in order to make sure that enough are fetched by default. This align roughly with the limit of manageable resources in CloudFormation.
6 years ago
Sloane Hertel f53f29352d Move AWS placebo fixtures into test/units/utils so module_utils tests can use them (#37300) 7 years ago
Kaz Cheng 60b5c6890a [cloud] Add template_body parameter to cloudformation module to allow lookups (#33485) 7 years ago
Jonathan Nuñez 67b1d0f274 CloudFormation module: get StackEvents when ClientRequestToken is not used (#32434)
* When getting the stack events we need to consider the case where we don't have ClientRequestToken fixes #32396

* Adding tests for the case when the ClientRequestToken is not present in the stack creation.

* Renaming the stack that the test for Client Request Token requires so it won't cause collisions with the basic test.
7 years ago
Ryan Brown 11c225e039 Start using ClientRequestTokens in event lists (#31997)
* Start using ClientRequestTokens in event lists

* Include request token in all reqs that support it (basically all but check mode/changeset)

* Update placebo recordings

* Add comments for CRQ popping
7 years ago
Matt Clay 11138abc51 Fix PEP 8 issues. 8 years ago
Ryan Brown 2196fa0e95 [cloud][tests] fixtures for placebo to test AWS modules using boto3 (#21253)
* [cloud][tests] Create fixtures for using placebo to test boto3-using modules

* Use pytest's importorskip instead of manually skipping on missing deps

* Fix imports in cloudformation module

* Delete unused code

* Add maybe_sleep fixtures to speed up recorded test runs

* Build basic placebo-CFN tests

* Commit placebo recordings of basic stack operations

* Add placebo to test-requires

* Allow unit tests to run regardless of environment by setting a default region

* Use explicit relative import for Python 3 compat

* Use __name__ attribute that works on Python 2 and 3
8 years ago