summaryrefslogtreecommitdiffstats
path: root/tests/test_backend_ldap.py
diff options
context:
space:
mode:
authorBrad Topol <btopol@us.ibm.com>2013-03-10 15:40:39 -0500
committerBrad Topol <btopol@us.ibm.com>2013-03-12 12:53:07 -0500
commitfe28ddaffeb020f32910a7c5c2c8629b85c2ef2f (patch)
tree1d597eb4248359fb7aa9543503e970fa7c0498ce /tests/test_backend_ldap.py
parent45228caa7335420d5c3bbe8a3c10e921e1dcaa3e (diff)
downloadkeystone-fe28ddaffeb020f32910a7c5c2c8629b85c2ef2f.tar.gz
keystone-fe28ddaffeb020f32910a7c5c2c8629b85c2ef2f.tar.xz
keystone-fe28ddaffeb020f32910a7c5c2c8629b85c2ef2f.zip
Added test cases to improve LDAP project testing
Fixes Bug1154216 Change-Id: I1d29643fc71e901ace20ea11d31c66c2f2349447
Diffstat (limited to 'tests/test_backend_ldap.py')
-rw-r--r--tests/test_backend_ldap.py49
1 files changed, 48 insertions, 1 deletions
diff --git a/tests/test_backend_ldap.py b/tests/test_backend_ldap.py
index 1f8d2a2b..c93749a7 100644
--- a/tests/test_backend_ldap.py
+++ b/tests/test_backend_ldap.py
@@ -417,7 +417,26 @@ class LDAPIdentity(test.TestCase, test_backend.IdentityTests):
raise nose.exc.SkipTest('Blocked by bug 1101276')
def test_project_crud(self):
- raise nose.exc.SkipTest('Blocked by bug 1101289')
+ # NOTE(topol): LDAP implementation does not currently support the
+ # updating of a project name so this method override
+ # provides a different update test
+ project = {'id': uuid.uuid4().hex, 'name': uuid.uuid4().hex,
+ 'domain_id': uuid.uuid4().hex,
+ 'description': uuid.uuid4().hex
+ }
+ self.identity_api.create_project(project['id'], project)
+ project_ref = self.identity_api.get_project(project['id'])
+ self.assertDictEqual(project_ref, project)
+
+ project['description'] = uuid.uuid4().hex
+ self.identity_api.update_project(project['id'], project)
+ project_ref = self.identity_api.get_project(project['id'])
+ self.assertDictEqual(project_ref, project)
+
+ self.identity_api.delete_project(project['id'])
+ self.assertRaises(exception.ProjectNotFound,
+ self.identity_api.get_project,
+ project['id'])
def test_get_and_remove_role_grant_by_group_and_cross_domain(self):
raise nose.exc.SkipTest('Blocked by bug 1101287')
@@ -526,6 +545,34 @@ class LDAPIdentityEnabledEmulation(LDAPIdentity):
self.assertDictEqual(user_ref, user)
self.assertDictEqual(tenant_ref, self.tenant_baz)
+ def test_project_crud(self):
+ # NOTE(topol): LDAPIdentityEnabledEmulation will create an
+ # enabled key in the project dictionary so this
+ # method override handles this side-effect
+ project = {'id': uuid.uuid4().hex, 'name': uuid.uuid4().hex,
+ 'domain_id': uuid.uuid4().hex,
+ 'description': uuid.uuid4().hex
+ }
+
+ self.identity_api.create_project(project['id'], project)
+ project_ref = self.identity_api.get_project(project['id'])
+
+ # self.identity_api.create_project adds an enabled
+ # key with a value of True when LDAPIdentityEnabledEmulation
+ # is used so we now add this expected key to the project dictionary
+ project['enabled'] = True
+ self.assertDictEqual(project_ref, project)
+
+ project['description'] = uuid.uuid4().hex
+ self.identity_api.update_project(project['id'], project)
+ project_ref = self.identity_api.get_project(project['id'])
+ self.assertDictEqual(project_ref, project)
+
+ self.identity_api.delete_project(project['id'])
+ self.assertRaises(exception.ProjectNotFound,
+ self.identity_api.get_project,
+ project['id'])
+
def test_user_crud(self):
user = {'domain_id': uuid.uuid4().hex, 'id': uuid.uuid4().hex,
'name': uuid.uuid4().hex, 'password': 'passw0rd'}