use token_client in token tests

This commit is contained in:
Jesse Andrews 2012-01-19 16:25:26 -08:00
parent 71faa9f0e1
commit 0df93ebd19
1 changed files with 4 additions and 5 deletions

View File

@ -96,21 +96,21 @@ class KcMasterTestCase(CompatTestCase):
client = self.get_client()
token = client.auth_token
token_client = self._client(token=token)
tenants = client.tenants.list()
tenants = token_client.tenants.list()
self.assertEquals(tenants[0].id, self.tenant_bar['id'])
def test_authenticate_token_tenant_id(self):
client = self.get_client()
token = client.auth_token
token_client = self._client(token=token, tenant_id='bar')
tenants = client.tenants.list()
tenants = token_client.tenants.list()
self.assertEquals(tenants[0].id, self.tenant_bar['id'])
def test_authenticate_token_tenant_name(self):
client = self.get_client()
token = client.auth_token
token_client = self._client(token=token, tenant_name='BAR')
tenants = client.tenants.list()
tenants = token_client.tenants.list()
self.assertEquals(tenants[0].id, self.tenant_bar['id'])
# TODO(termie): I'm not really sure that this is testing much
@ -173,7 +173,6 @@ class KcMasterTestCase(CompatTestCase):
# use python's scope fall through to leave roleref_ref set
break
client.roles.remove_user_from_tenant(self.tenant_baz['id'],
self.user_foo['id'],
roleref_ref.id)
@ -296,7 +295,7 @@ class KcMasterTestCase(CompatTestCase):
two = self.get_client(self.user_two)
self.assertRaises(client_exceptions.Unauthorized, two.ec2.delete,
self.user_foo['id'], cred.access)
foo.ec2.delete(self.user_foo['id'], cred.access)
def test_service_create_and_delete(self):