diff options
| author | Jesse Andrews <anotherjesse@gmail.com> | 2011-12-21 20:52:10 -0800 |
|---|---|---|
| committer | Jesse Andrews <anotherjesse@gmail.com> | 2011-12-21 21:01:25 -0800 |
| commit | e4428dc3399406416c5b8a76ade1eb694fc19538 (patch) | |
| tree | 0d8d06afe272fb630104aecbe2cf35582d7bc293 | |
| parent | 99f81d5e0f33c1d11d321befe9f5a54db3dc8860 (diff) | |
working on a tenant_create test
| -rw-r--r-- | tests/test_keystoneclient_compat.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test_keystoneclient_compat.py b/tests/test_keystoneclient_compat.py index fb605411..760f78b1 100644 --- a/tests/test_keystoneclient_compat.py +++ b/tests/test_keystoneclient_compat.py @@ -85,3 +85,20 @@ class MasterCompatTestCase(CompatTestCase): client.authenticate() tenants = client.tenants.list() self.assertEquals(tenants[0].id, self.tenant_bar['id']) + + # FIXME(ja): this test should require the "keystone:admin" roled + # (probably the role set via --keystone_admin_role flag) + # FIXME(ja): add a test that admin endpoint is only sent to admin user + # FIXME(ja): add a test that admin endpoint returns unauthorized if not admin + def test_tenant_create(self): + from keystoneclient.v2_0 import client as ks_client + port = self.server.socket_info['socket'][1] + self.options['public_port'] = port + # NOTE(termie): novaclient wants a "/" at the end, keystoneclient does not + client = ks_client.Client(auth_url="http://localhost:%s/v2.0/" % port, + username='FOO', + password='foo', + tenant_id='bar') + client.authenticate() + client.tenants.create("hello", description="My new tenant!", enabled=True) + # FIXME(ja): assert tenant was created |
