summaryrefslogtreecommitdiff
path: root/keystone/tests/test_backend.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2014-02-08 18:06:50 +0000
committerGerrit Code Review <review@openstack.org>2014-02-08 18:06:50 +0000
commitcfccc98d0073cd88e4fd1d6285fda30f89e47200 (patch)
tree5451fa72c2e3dcc7efd550bdff36204d98aa649e /keystone/tests/test_backend.py
parent68bd81eee90fa9f6e802d1e794595d093dea3542 (diff)
parentab1b0c283bd37b2f547aa087bd722aaa3f973df2 (diff)
downloadkeystone-cfccc98d0073cd88e4fd1d6285fda30f89e47200.tar.gz
Merge "Fix assignment to not require user or group existence"
Diffstat (limited to 'keystone/tests/test_backend.py')
-rw-r--r--keystone/tests/test_backend.py23
1 files changed, 13 insertions, 10 deletions
diff --git a/keystone/tests/test_backend.py b/keystone/tests/test_backend.py
index efc118030..c99f290ec 100644
--- a/keystone/tests/test_backend.py
+++ b/keystone/tests/test_backend.py
@@ -723,12 +723,6 @@ class IdentityTests(object):
uuid.uuid4().hex)
def test_add_role_to_user_and_project_404(self):
- self.assertRaises(exception.UserNotFound,
- self.assignment_api.add_role_to_user_and_project,
- uuid.uuid4().hex,
- self.tenant_bar['id'],
- self.role_admin['id'])
-
self.assertRaises(exception.ProjectNotFound,
self.assignment_api.add_role_to_user_and_project,
self.user_foo['id'],
@@ -741,6 +735,13 @@ class IdentityTests(object):
self.tenant_bar['id'],
uuid.uuid4().hex)
+ def test_add_role_to_user_and_project_no_user(self):
+ # If add_role_to_user_and_project and the user doesn't exist, then
+ # no error.
+ user_id_not_exist = uuid.uuid4().hex
+ self.assignment_api.add_role_to_user_and_project(
+ user_id_not_exist, self.tenant_bar['id'], self.role_admin['id'])
+
def test_remove_role_from_user_and_project(self):
self.assignment_api.add_role_to_user_and_project(
self.user_foo['id'], self.tenant_bar['id'], 'member')
@@ -1567,10 +1568,12 @@ class IdentityTests(object):
uuid.uuid4().hex,
self.user_foo['id'])
- self.assertRaises(exception.UserNotFound,
- self.assignment_api.add_user_to_project,
- self.tenant_bar['id'],
- uuid.uuid4().hex)
+ def test_add_user_to_project_no_user(self):
+ # If add_user_to_project and the user doesn't exist, then
+ # no error.
+ user_id_not_exist = uuid.uuid4().hex
+ self.assignment_api.add_user_to_project(self.tenant_bar['id'],
+ user_id_not_exist)
def test_remove_user_from_project(self):
self.assignment_api.add_user_to_project(self.tenant_baz['id'],