summaryrefslogtreecommitdiff
path: root/heatclient/tests
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2020-02-21 07:52:00 +0000
committerGerrit Code Review <review@openstack.org>2020-02-21 07:52:00 +0000
commit866e90374ec08727161a5e00b409804a7c2e945f (patch)
tree26d59bb360516dc3c48519a98f876edf35b0de26 /heatclient/tests
parent207968f353f435d315ff25194e35251bb260df35 (diff)
parent033511c291c811f9368aaccdc81de3c9c93c9ae2 (diff)
downloadpython-heatclient-866e90374ec08727161a5e00b409804a7c2e945f.tar.gz
Merge "Allow to set poll interval to OSC stack create"
Diffstat (limited to 'heatclient/tests')
-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})