diff options
| author | Dolph Mathews <dolph.mathews@gmail.com> | 2012-03-25 12:03:26 -0500 |
|---|---|---|
| committer | Dolph Mathews <dolph.mathews@gmail.com> | 2012-03-27 18:55:42 -0700 |
| commit | 9e4fe654ed3f2fa4040ccbcd0ccc003f56f9bce2 (patch) | |
| tree | c0b3b59eefc195a3c62101bbc537ec8b0a3155d6 /tests | |
| parent | a9c6fb1d39f84f79f97333f59ef757cfd9dc8fd2 (diff) | |
| download | keystone-9e4fe654ed3f2fa4040ccbcd0ccc003f56f9bce2.tar.gz keystone-9e4fe654ed3f2fa4040ccbcd0ccc003f56f9bce2.tar.xz keystone-9e4fe654ed3f2fa4040ccbcd0ccc003f56f9bce2.zip | |
user-role-crud 404 (bug 963056)
user-role-add
user-role-remove
Change-Id: I1b3cd019d0d110b01ed175822cdd6c9ddb486412
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_keystoneclient.py | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/test_keystoneclient.py b/tests/test_keystoneclient.py index 95a06ecb..aa2a5f6d 100644 --- a/tests/test_keystoneclient.py +++ b/tests/test_keystoneclient.py @@ -670,6 +670,49 @@ class KcMasterTestCase(CompatTestCase, KeystoneClientTests): user_refs = client.tenants.list_users(tenant=self.tenant_baz['id']) self.assert_(self.user_foo['id'] not in [x.id for x in user_refs]) + def test_user_role_add_404(self): + from keystoneclient import exceptions as client_exceptions + client = self.get_client(admin=True) + self.assertRaises(client_exceptions.NotFound, + client.roles.add_user_role, + tenant=uuid.uuid4().hex, + user=self.user_foo['id'], + role=self.role_useless['id']) + self.assertRaises(client_exceptions.NotFound, + client.roles.add_user_role, + tenant=self.tenant_baz['id'], + user=uuid.uuid4().hex, + role=self.role_useless['id']) + self.assertRaises(client_exceptions.NotFound, + client.roles.add_user_role, + tenant=self.tenant_baz['id'], + user=self.user_foo['id'], + role=uuid.uuid4().hex) + + def test_user_role_remove_404(self): + from keystoneclient import exceptions as client_exceptions + client = self.get_client(admin=True) + self.assertRaises(client_exceptions.NotFound, + client.roles.remove_user_role, + tenant=uuid.uuid4().hex, + user=self.user_foo['id'], + role=self.role_useless['id']) + self.assertRaises(client_exceptions.NotFound, + client.roles.remove_user_role, + tenant=self.tenant_baz['id'], + user=uuid.uuid4().hex, + role=self.role_useless['id']) + self.assertRaises(client_exceptions.NotFound, + client.roles.remove_user_role, + tenant=self.tenant_baz['id'], + user=self.user_foo['id'], + role=uuid.uuid4().hex) + self.assertRaises(client_exceptions.NotFound, + client.roles.remove_user_role, + tenant=self.tenant_baz['id'], + user=self.user_foo['id'], + role=self.role_useless['id']) + def test_tenant_list_marker(self): client = self.get_client() |
