summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Bogott <abogott@wikimedia.org>2012-08-21 17:52:58 -0500
committerAndrew Bogott <abogott@wikimedia.org>2012-08-21 18:00:35 -0500
commitaf52ef1479861ffdf3aa3a334fc9fffc8faa8843 (patch)
tree25c00c3cb7696fa5db41da0ea2a6dafbf202718c
parent5419afce36090d2e6dd37fb7e62066a9dc872c1d (diff)
downloadkeystone-af52ef1479861ffdf3aa3a334fc9fffc8faa8843.tar.gz
keystone-af52ef1479861ffdf3aa3a334fc9fffc8faa8843.tar.xz
keystone-af52ef1479861ffdf3aa3a334fc9fffc8faa8843.zip
Demonstrate that authenticate() returns roles.
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
-rw-r--r--tests/test_backend.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_backend.py b/tests/test_backend.py
index 9f60645c..6d1e1387 100644
--- a/tests/test_backend.py
+++ b/tests/test_backend.py
@@ -68,6 +68,16 @@ class IdentityTests(object):
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