summaryrefslogtreecommitdiff
path: root/keystoneclient/tests
diff options
context:
space:
mode:
authorlin-hua-cheng <os.lcheng@gmail.com>2014-12-19 16:15:13 -0800
committerlin-hua-cheng <os.lcheng@gmail.com>2014-12-27 21:07:01 -0800
commit1b8c3c8cb90c03881e0a648f247a186fe4b494de (patch)
tree8fd3d67ecd3b2daab702db84842aed8fb9023d11 /keystoneclient/tests
parent10860db5f155052ca0d353ce9058e1c16eec8437 (diff)
downloadpython-keystoneclient-1b8c3c8cb90c03881e0a648f247a186fe4b494de.tar.gz
Updated service name to be optional in CLI
Service name is optional in the API, updating the CLI for consistency. Change-Id: I94f0eb248a39d2f59edd00a5f90125a5c42525ed Closes-Bug: #1393977 Closes-Bug: #1404073
Diffstat (limited to 'keystoneclient/tests')
-rw-r--r--keystoneclient/tests/v2_0/test_shell.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/keystoneclient/tests/v2_0/test_shell.py b/keystoneclient/tests/v2_0/test_shell.py
index 57bbe9d..7cfed80 100644
--- a/keystoneclient/tests/v2_0/test_shell.py
+++ b/keystoneclient/tests/v2_0/test_shell.py
@@ -268,16 +268,27 @@ class ShellTests(utils.TestCase):
self.run_command('tenant-delete 2')
self.assert_called('DELETE', '/tenants/2')
- def test_service_create(self):
+ def test_service_create_with_required_arguments_only(self):
self.stub_url('POST', ['OS-KSADM', 'services'],
json={'OS-KSADM:service': {}})
- self.run_command('service-create --name service1 --type compute')
+ self.run_command('service-create --type compute')
self.assert_called('POST', '/OS-KSADM/services')
json = {"OS-KSADM:service": {"type": "compute",
- "name": "service1",
+ "name": None,
"description": None}}
self.assertRequestBodyIs(json=json)
+ def test_service_create_with_all_arguments(self):
+ self.stub_url('POST', ['OS-KSADM', 'services'],
+ json={'OS-KSADM:service': {}})
+ self.run_command('service-create --type compute '
+ '--name service1 --description desc1')
+ self.assert_called('POST', '/OS-KSADM/services')
+ json = {"OS-KSADM:service": {"type": "compute",
+ "name": "service1",
+ "description": "desc1"}}
+ self.assertRequestBodyIs(json=json)
+
def test_service_get(self):
self.stub_url('GET', ['OS-KSADM', 'services', '1'],
json={'OS-KSADM:service': {'id': '1'}})