Skip to content

Commit

Permalink
Demonstrate that authenticate() returns roles.
Browse files Browse the repository at this point in the history
This is related to lp 1035428; that bug is fixed in folsom,
but this test is also about to appear in stable/essex.

Change-Id: Iadd4091339aab2c3a8d474b44dcd11f8bfd1d510
  • Loading branch information
Andrew Bogott committed Aug 21, 2012
1 parent 5419afc commit af52ef1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_backend.py
Expand Up @@ -68,6 +68,16 @@ def test_authenticate(self):
self.assertDictEqual(tenant_ref, self.tenant_bar)
self.assertDictEqual(metadata_ref, self.metadata_foobar)

def test_authenticate_role_return(self):
self.identity_api.add_role_to_user_and_tenant(
self.user_foo['id'], self.tenant_bar['id'], 'keystone_admin')
user_ref, tenant_ref, metadata_ref = self.identity_api.authenticate(
user_id=self.user_foo['id'],
tenant_id=self.tenant_bar['id'],
password=self.user_foo['password'])
self.assertIn('roles', metadata_ref)
self.assertIn('keystone_admin', metadata_ref['roles'])

def test_authenticate_no_metadata(self):
user = self.user_no_meta
tenant = self.tenant_baz
Expand Down

0 comments on commit af52ef1

Please sign in to comment.