|
19 | 19 | from openstack.orchestration.v1 import software_config as sc |
20 | 20 | from openstack.orchestration.v1 import software_deployment as sd |
21 | 21 | from openstack.orchestration.v1 import stack |
| 22 | +from openstack.orchestration.v1 import stack_template |
22 | 23 | from openstack.orchestration.v1 import template |
23 | 24 | from openstack.tests.unit import test_proxy_base2 |
24 | 25 |
|
@@ -74,6 +75,36 @@ def test_check_stack_with_stack_ID(self, mock_stack): |
74 | 75 | mock_stack.assert_called_once_with(id='FAKE_ID') |
75 | 76 | stk.check.assert_called_once_with(self.proxy._session) |
76 | 77 |
|
| 78 | + @mock.patch.object(stack.Stack, 'find') |
| 79 | + def test_get_stack_template_with_stack_identity(self, mock_find): |
| 80 | + stack_id = '1234' |
| 81 | + stack_name = 'test_stack' |
| 82 | + stk = stack.Stack(id=stack_id, name=stack_name) |
| 83 | + mock_find.return_value = stk |
| 84 | + |
| 85 | + self._verify2('openstack.proxy2.BaseProxy._get', |
| 86 | + self.proxy.get_stack_template, |
| 87 | + method_args=['IDENTITY'], |
| 88 | + expected_args=[stack_template.StackTemplate], |
| 89 | + expected_kwargs={'requires_id': False, |
| 90 | + 'stack_name': stack_name, |
| 91 | + 'stack_id': stack_id}) |
| 92 | + mock_find.assert_called_once_with(mock.ANY, 'IDENTITY', |
| 93 | + ignore_missing=False) |
| 94 | + |
| 95 | + def test_get_stack_template_with_stack_object(self): |
| 96 | + stack_id = '1234' |
| 97 | + stack_name = 'test_stack' |
| 98 | + stk = stack.Stack(id=stack_id, name=stack_name) |
| 99 | + |
| 100 | + self._verify2('openstack.proxy2.BaseProxy._get', |
| 101 | + self.proxy.get_stack_template, |
| 102 | + method_args=[stk], |
| 103 | + expected_args=[stack_template.StackTemplate], |
| 104 | + expected_kwargs={'requires_id': False, |
| 105 | + 'stack_name': stack_name, |
| 106 | + 'stack_id': stack_id}) |
| 107 | + |
77 | 108 | @mock.patch.object(stack.Stack, 'find') |
78 | 109 | def test_resources_with_stack_object(self, mock_find): |
79 | 110 | stack_id = '1234' |
|
0 commit comments