moto/tests/test_cloudformation
Modhaffer Rahmani 8fe5a680a5
Added explicit exception raise when no stack found. (#3559)
* Added explicit exception raise when no stack found.

Currently, any operation that uses 'get_stack' method from 'CloudFormationBackend' class
will fail with AttributeError or jinja2 exception if ran against non-existing stack(created/deleted)
To fix the issue I explicitly raised a 'ValidationError' exception.
Added tests for boto and boto3 responses.

* Moved non-existing stack tests to 'test_stack_events'

When using 'update_stack' to test raising an exception when the stack doesn't exist
test coverage dropped by 0.5%. I am using stack_events instead.

* Removed some unreachable paths

After adding the exception couple of paths in the code are unreachable as 'get_stack' doesn't return 'None' anymore.
This is the reason why coverall was reporting decreased coverage.

* Removed an unreachable path I missed

* Added couple of tests in cloudformation/models

* Added more assertions around raised exception

* Formatted document using black to fix issue with travis.
2021-01-16 14:42:51 +00:00
..
fixtures Change whitespaces back to the way they were and fix typos 2020-01-23 15:46:50 +01:00
__init__.py from __future__ import unicode_literals 2014-08-27 11:33:55 -04:00
test_cloudformation_depends_on.py Linting 2020-11-11 15:55:37 +00:00
test_cloudformation_stack_crud_boto3.py Added explicit exception raise when no stack found. (#3559) 2021-01-16 14:42:51 +00:00
test_cloudformation_stack_crud.py Added explicit exception raise when no stack found. (#3559) 2021-01-16 14:42:51 +00:00
test_cloudformation_stack_integration.py Use known ImageID in internal tests (#3555) 2021-01-13 09:02:11 +00:00
test_import_value.py Run black on moto & test directories. 2019-10-31 10:36:05 -07:00
test_server.py Run black on moto & test directories. 2019-10-31 10:36:05 -07:00
test_stack_parsing.py Remove boto package dependency 2020-11-26 23:59:15 -08:00
test_validate.py Use known ImageID in internal tests (#3555) 2021-01-13 09:02:11 +00:00