176
176
shell('ec2-credentials-delete')
177
177
assert do_shell_mock.called
179
def test_do_endpoints(self):
180
do_shell_mock = mock.MagicMock()
181
# grab the decorators for do_endpoint_create
182
shell_func = getattr(shell_v2_0, 'do_endpoint_create')
183
do_shell_mock.arguments = getattr(shell_func, 'arguments', [])
184
with mock.patch('keystoneclient.v2_0.shell.do_endpoint_create',
188
shell('endpoint-create '
189
'--service_id=2 --publicurl=http://example.com:1234/go '
190
'--adminurl=http://example.com:9876/adm')
191
assert do_shell_mock.called
192
((a, b), c) = do_shell_mock.call_args
193
assert (b.auth_url, b.password, b.os_tenant_id,
194
b.tenant_name, b.username, b.identity_api_version) == \
195
(DEFAULT_AUTH_URL, DEFAULT_PASSWORD, DEFAULT_TENANT_ID,
196
DEFAULT_TENANT_NAME, DEFAULT_USERNAME, '')
197
assert (b.service_id, b.publicurl, b.adminurl) == ('2',
198
'http://example.com:1234/go',
199
'http://example.com:9876/adm')