heat/heat/tests/aws
Zane Bitter 38fad07c0a Unit tests: Fix mock errors with too few side effects
When a mock hasn't been provided with a long-enough list of side-effects
for the number of times it is called, it raises StopIteration (instead
of something sensible like AssertionError). Prior to Python 3.7, this
exception could bubble up until it just stopped a task. (In Python 3.7
it will eventually be caught and turned into a RuntimeError.)

To ensure that any errors of this sort are not handled silently, and to
enable us to test for them prior to using Python 3.7, catch any
StopIteration errors coming from plugin-provided non-generator functions
and convert them to RuntimeError exceptions.

This reveals many errors in the unit tests, many introduced in the
process of converting from mox to mock, which are also fixed by this
patch.

Change-Id: I5a1eff6b704dff7c17edcbbe58cdbc380ae6abc9
Story: #2003412
Task: 24553
2018-08-10 17:25:13 -04:00
..
__init__.py Enable some unit tests back 2015-02-03 10:20:16 +08:00
test_eip.py Change NovaClientPlugin to use MicroversionMixin 2018-06-29 09:37:44 +05:30
test_instance.py Remove mox from test_instance 2018-03-28 21:26:28 -04:00
test_instance_network.py Change NovaClientPlugin to use MicroversionMixin 2018-06-29 09:37:44 +05:30
test_loadbalancer.py Change NovaClientPlugin to use MicroversionMixin 2018-06-29 09:37:44 +05:30
test_network_interface.py Remove mox usage from `aws/test_network_interface.py` 2018-04-27 14:44:53 +08:00
test_s3.py Remove mox from test_s3 2018-04-03 08:07:31 +05:30
test_security_group.py Unit tests: Fix mock errors with too few side effects 2018-08-10 17:25:13 -04:00
test_user.py Remove mox from test_user 2018-04-03 08:07:31 +05:30
test_volume.py Unit tests: Fix mock errors with too few side effects 2018-08-10 17:25:13 -04:00
test_waitcondition.py Remove mox usage from `aws/test_waitcondition.py` 2018-04-27 14:44:53 +08:00