summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDerek Yarnell <derek@umiacs.umd.edu>2012-04-16 15:23:12 -0400
committerAdam Young <ayoung@redhat.com>2012-09-10 14:39:11 -0400
commit235c4ce3d7d5459974fa1995f6d58f4268ebfc7e (patch)
tree1caecd17d5a21deea1b02493cc7326cdb8ae5d92 /tests
parent832ce92545611efee0fe39fd3e063a6379f8ba5b (diff)
downloadkeystone-235c4ce3d7d5459974fa1995f6d58f4268ebfc7e.tar.gz
keystone-235c4ce3d7d5459974fa1995f6d58f4268ebfc7e.tar.xz
keystone-235c4ce3d7d5459974fa1995f6d58f4268ebfc7e.zip
Implementation of tenant,user,role list functions for ldap
Bug 983304 Defines functions for the retrival and return of the tenant, user and role objects in ldap. They will return in whatever order LDAP provides them. Additional fix for pep8 whitespace violation. Additional change to add some minimal unit tests for the new functions Tests have successfully run against a live LDAP server Change-Id: I368ae4097bb9bcdaab7bca0ccc2f9204d58f69d8
Diffstat (limited to 'tests')
-rw-r--r--tests/test_backend.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/test_backend.py b/tests/test_backend.py
index dd843808..72ed5b57 100644
--- a/tests/test_backend.py
+++ b/tests/test_backend.py
@@ -16,6 +16,7 @@
import datetime
import uuid
+import default_fixtures
from keystone import exception
from keystone.openstack.common import timeutils
@@ -608,6 +609,36 @@ class IdentityTests(object):
'fake1',
user)
+ def test_list_users(self):
+ users = self.identity_api.list_users()
+ for test_user in default_fixtures.USERS:
+ user_id = test_user['id']
+ found = False
+ for user in users:
+ if user['id'] == user_id:
+ found = True
+ self.assertTrue('found')
+
+ def test_list_roles(self):
+ roles = self.identity_api.list_roles()
+ for test_role in default_fixtures.ROLES:
+ role_id = test_role['id']
+ found = False
+ for role in roles:
+ if role['id'] == role_id:
+ found = True
+ self.assertTrue('found')
+
+ def test_get_tenants(self):
+ tenants = self.identity_api.get_tenants()
+ for test_tenant in default_fixtures.TENANTS:
+ tenant_id = test_tenant['id']
+ found = False
+ for tenant in tenants:
+ if tenant['id'] == tenant_id:
+ found = True
+ self.assertTrue('found')
+
class TokenTests(object):
def test_token_crud(self):