From af52ef1479861ffdf3aa3a334fc9fffc8faa8843 Mon Sep 17 00:00:00 2001 From: Andrew Bogott Date: Tue, 21 Aug 2012 17:52:58 -0500 Subject: 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 --- tests/test_backend.py | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 -- cgit