diff options
author | Ross Brattain <ross.b.brattain@intel.com> | 2018-03-28 20:04:43 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2018-03-28 20:04:43 +0000 |
commit | c6a42e58668389e70320601565eb0a677f1105cd (patch) | |
tree | 62b2b9100d4b244c4de47b6c601bcfe554ddf2d4 /yardstick/tests | |
parent | 5293564955b96ff3973f498b1f526e70e792b12b (diff) | |
parent | 91c308a6248a7412d00c1435c8bdbb21bec88540 (diff) |
Merge "restore Heat stack failure logs for CI"
Diffstat (limited to 'yardstick/tests')
-rw-r--r-- | yardstick/tests/unit/orchestrator/test_heat.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/yardstick/tests/unit/orchestrator/test_heat.py b/yardstick/tests/unit/orchestrator/test_heat.py index aae2487aa..9598eeb04 100644 --- a/yardstick/tests/unit/orchestrator/test_heat.py +++ b/yardstick/tests/unit/orchestrator/test_heat.py @@ -354,13 +354,30 @@ class HeatTemplateTestCase(unittest.TestCase): 3600) self.assertEqual(heat_stack, ret) - def test_create_block_status_no_complete(self): heat_stack = mock.Mock() heat_stack.status = 'other status' + heat_stack.get_failures.return_value = [] with mock.patch.object(heat, 'HeatStack', return_value=heat_stack): self.assertRaises(exceptions.HeatTemplateError, self.template.create, block=True) heat_stack.create.assert_called_once_with( self.template._template, self.template.heat_parameters, True, 3600) + + def test_create_block_status_no_complete_with_reasons(self): + heat_stack = mock.Mock() + heat_stack.status = 'other status' + heat_stack.get_failures.return_value = [ + mock.Mock(resource_status_reason="A reason"), + mock.Mock(resource_status_reason="Something else") + ] + with mock.patch.object(heat, 'HeatStack', return_value=heat_stack): + with mock.patch.object(heat, 'log') as mock_log: + self.assertRaises(exceptions.HeatTemplateError, + self.template.create, block=True) + mock_log.error.assert_any_call("%s", "A reason") + mock_log.error.assert_any_call("%s", "Something else") + heat_stack.create.assert_called_once_with( + self.template._template, self.template.heat_parameters, True, + 3600) |