summaryrefslogtreecommitdiff
path: root/heatclient/tests/unit/osc/v1/test_stack.py
diff options
context:
space:
mode:
Diffstat (limited to 'heatclient/tests/unit/osc/v1/test_stack.py')
-rw-r--r--heatclient/tests/unit/osc/v1/test_stack.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/heatclient/tests/unit/osc/v1/test_stack.py b/heatclient/tests/unit/osc/v1/test_stack.py
index 146c1bc..d6a51b0 100644
--- a/heatclient/tests/unit/osc/v1/test_stack.py
+++ b/heatclient/tests/unit/osc/v1/test_stack.py
@@ -148,6 +148,24 @@ class TestStackCreate(TestStack):
self.cmd.take_action(parsed_args)
+ mock_poll.assert_called_once_with(mock.ANY, 'my_stack',
+ action='CREATE', poll_period=5)
+ self.stack_client.create.assert_called_with(**self.defaults)
+ self.stack_client.get.assert_called_with(**{'stack_id': '1234',
+ 'resolve_outputs': False})
+
+ @mock.patch('heatclient.common.event_utils.poll_for_events',
+ return_value=('CREATE_COMPLETE',
+ 'Stack my_stack CREATE_COMPLETE'))
+ def test_stack_create_wait_with_poll(self, mock_poll):
+ arglist = ['my_stack', '-t', self.template_path, '--wait',
+ '--poll', '10']
+ parsed_args = self.check_parser(self.cmd, arglist, [])
+
+ self.cmd.take_action(parsed_args)
+
+ mock_poll.assert_called_once_with(mock.ANY, 'my_stack',
+ action='CREATE', poll_period=10)
self.stack_client.create.assert_called_with(**self.defaults)
self.stack_client.get.assert_called_with(**{'stack_id': '1234',
'resolve_outputs': False})