diff options
author | Brant Knudson <bknudson@us.ibm.com> | 2013-10-21 15:21:12 -0500 |
---|---|---|
committer | Brant Knudson <bknudson@us.ibm.com> | 2013-10-21 15:21:12 -0500 |
commit | b17e7bec768bd53d3977352486378698a3db3cfa (patch) | |
tree | 1219f7b8a7edf3d739490ce335736a358f416711 /keystone/tests/test_backend.py | |
parent | 2df1b7cba4ccdb24c6803f74dc0cd46b0b30b195 (diff) | |
download | keystone-b17e7bec768bd53d3977352486378698a3db3cfa.tar.gz |
Enhance tests for deleting a role not assigned
There wasn't a test that showed what happens when a role is
deleted that was never assigned.
Change-Id: I2845e3f03dc8e8f1dd41d8f41d2f6669004bc506
Related-bug: #1242855
Diffstat (limited to 'keystone/tests/test_backend.py')
-rw-r--r-- | keystone/tests/test_backend.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/keystone/tests/test_backend.py b/keystone/tests/test_backend.py index c6bcd32e8..caf33a632 100644 --- a/keystone/tests/test_backend.py +++ b/keystone/tests/test_backend.py @@ -61,6 +61,15 @@ class IdentityTests(object): self.tenant_bar['id']) self.assertNotIn(self.user_two['id'], user_ids) + def test_remove_user_role_not_assigned(self): + # Expect failure if attempt to remove a role that was never assigned to + # the user. + self.assertRaises(exception.RoleNotFound, + self.identity_api.remove_role_from_user_and_project, + tenant_id=self.tenant_bar['id'], + user_id=self.user_two['id'], + role_id=self.role_other['id']) + def test_authenticate_bad_user(self): self.assertRaises(AssertionError, self.identity_api.authenticate, |