Ensure token refresh. Fixes bug 1044316.

FAIL of test
  Request to list user's roles without a valid token should fail
used to be causing ERROR of
  Remove a role assigned to a user on a tenant

Solved by ensuring that this FAIL has no side-effects.

Change-Id: Ide5849f70aab26e2af2a52ed83371da9c51bf5d7
This commit is contained in:
Jaroslav Henner 2012-08-16 10:32:38 +02:00
parent fe2cdfc6c1
commit 501cacdf6d
1 changed files with 6 additions and 4 deletions

View File

@ -237,10 +237,12 @@ class UserRolesTest(RolesTest):
(user, tenant, role) = self._get_role_params()
token = self.client.get_auth()
self.client.delete_token(token)
self.assertRaises(exceptions.Unauthorized,
self.client.list_user_roles, tenant['id'],
user['id'])
self.client.clear_auth()
try:
self.assertRaises(exceptions.Unauthorized,
self.client.list_user_roles, tenant['id'],
user['id'])
finally:
self.client.clear_auth()
def test_list_user_roles_for_non_existent_user(self):
"""Attempt to list roles of a non existent user should fail"""