summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authortermie <github@anarkystic.com>2011-12-28 13:58:49 -0800
committertermie <github@anarkystic.com>2011-12-28 13:58:49 -0800
commit2e1558ebd2dba1d2adb89160d1bb1f4e2020f762 (patch)
treed19478ff0c294118ecfb0df0123419cce71943b0 /tests
parent32aa1dedb7cd5f1cae6531e72b122fca60ec9e19 (diff)
downloadkeystone-2e1558ebd2dba1d2adb89160d1bb1f4e2020f762.tar.gz
keystone-2e1558ebd2dba1d2adb89160d1bb1f4e2020f762.tar.xz
keystone-2e1558ebd2dba1d2adb89160d1bb1f4e2020f762.zip
clean up keystoneclient setup
Diffstat (limited to 'tests')
-rw-r--r--tests/test_backend_kvs.py4
-rw-r--r--tests/test_keystoneclient_compat.py44
2 files changed, 19 insertions, 29 deletions
diff --git a/tests/test_backend_kvs.py b/tests/test_backend_kvs.py
index 8ec1e607..d23605b6 100644
--- a/tests/test_backend_kvs.py
+++ b/tests/test_backend_kvs.py
@@ -9,8 +9,8 @@ import default_fixtures
class KvsIdentity(test.TestCase):
def setUp(self):
super(KvsIdentity, self).setUp()
- options = self.appconfig('default')
- self.identity_api = kvs.KvsIdentity(options=options, db={})
+ self.options = self.appconfig('default')
+ self.identity_api = kvs.KvsIdentity(options=self.options, db={})
self.load_fixtures(default_fixtures)
def test_authenticate_bad_user(self):
diff --git a/tests/test_keystoneclient_compat.py b/tests/test_keystoneclient_compat.py
index 1c64ddb3..e0eec5f4 100644
--- a/tests/test_keystoneclient_compat.py
+++ b/tests/test_keystoneclient_compat.py
@@ -2,6 +2,8 @@ from keystonelight import models
from keystonelight import test
from keystonelight import utils
+import default_fixtures
+
KEYSTONECLIENT_REPO = 'git://github.com/openstack/python-keystoneclient.git'
@@ -37,32 +39,18 @@ class MasterCompatTestCase(CompatTestCase):
self.app = self.loadapp('keystoneclient_compat_master')
self.options = self.appconfig('keystoneclient_compat_master')
-
- self.identity_backend = utils.import_object(
- self.options['identity_driver'], options=self.options)
- self.token_backend = utils.import_object(
- self.options['token_driver'], options=self.options)
- self.catalog_backend = utils.import_object(
- self.options['catalog_driver'], options=self.options)
+ self.load_backends()
+ self.load_fixtures(default_fixtures)
self.server = self.serveapp('keystoneclient_compat_master')
- self.tenant_bar = self.identity_backend.create_tenant(
- 'bar',
- models.Tenant(id='bar', name='BAR'))
-
- self.user_foo = self.identity_backend.create_user(
- 'foo',
- models.User(id='foo',
- name='FOO',
- tenants=[self.tenant_bar['id']],
- password='foo'))
-
- self.extras_bar_foo = self.identity_backend.create_extras(
+ # TODO(termie): is_admin is being deprecated once the policy stuff
+ # is all working
+ # TODO(termie): add an admin user to the fixtures and use that user
+ # override the fixtures, for now
+ self.extras_foobar = self.identity_api.update_extras(
self.user_foo['id'], self.tenant_bar['id'],
- dict(roles=[],
- is_admin='1',
- roles_links=[]))
+ dict(roles=['keystone_admin'], is_admin='1'))
# def test_authenticate(self):
# from keystoneclient.v2_0 import client as ks_client
@@ -77,7 +65,7 @@ class MasterCompatTestCase(CompatTestCase):
def test_authenticate_tenant_name_and_tenants(self):
client = self._client(auth_url=self._url(),
username='FOO',
- password='foo',
+ password='foo2',
tenant_name='BAR')
tenants = client.tenants.list()
self.assertEquals(tenants[0].id, self.tenant_bar['id'])
@@ -85,7 +73,7 @@ class MasterCompatTestCase(CompatTestCase):
def test_authenticate_tenant_id_and_tenants(self):
client = self._client(auth_url=self._url(),
username='FOO',
- password='foo',
+ password='foo2',
tenant_id='bar')
tenants = client.tenants.list()
self.assertEquals(tenants[0].id, self.tenant_bar['id'])
@@ -93,11 +81,13 @@ class MasterCompatTestCase(CompatTestCase):
# 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
+ # FIXME(ja): add a test that admin endpoint returns unauthorized if not
+ # admin
def test_tenant_create(self):
client = self._client(auth_url=self._url(),
username='FOO',
- password='foo',
+ password='foo2',
tenant_name='BAR')
- client.tenants.create("hello", description="My new tenant!", enabled=True)
+ client.tenants.create(
+ "hello", description="My new tenant!", enabled=True)
# FIXME(ja): assert tenant was created