summaryrefslogtreecommitdiff
path: root/keystoneclient/tests
diff options
context:
space:
mode:
authorKristi Nikolla <knikolla@bu.edu>2017-06-16 11:30:56 -0400
committerKristi Nikolla <knikolla@bu.edu>2017-06-16 11:30:56 -0400
commitef49844248661671063567f98016e88943955ba0 (patch)
tree0679ca79ad63058554d0ac00bc10c3f6aabc49d7 /keystoneclient/tests
parent2ab7f6df1207f2da38fa893518228a695aea8ecd (diff)
downloadpython-keystoneclient-ef49844248661671063567f98016e88943955ba0.tar.gz
Add support for specifying role ids when creating trust
Change-Id: I38e0ac35946ee6e53128babac3ea759a380572e0 Partial-Bug: 1696111
Diffstat (limited to 'keystoneclient/tests')
-rw-r--r--keystoneclient/tests/unit/v3/test_trusts.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/keystoneclient/tests/unit/v3/test_trusts.py b/keystoneclient/tests/unit/v3/test_trusts.py
index 72fb5b7..1c74ac9 100644
--- a/keystoneclient/tests/unit/v3/test_trusts.py
+++ b/keystoneclient/tests/unit/v3/test_trusts.py
@@ -64,6 +64,22 @@ class TrustTests(utils.ClientTestCase, utils.CrudTests):
req_ref['roles'] = [{'name': 'atestrole'}]
super(TrustTests, self).test_create(ref=ref, req_ref=req_ref)
+ def test_create_role_id_and_names(self):
+ ref = self.new_ref()
+ ref['trustor_user_id'] = uuid.uuid4().hex
+ ref['trustee_user_id'] = uuid.uuid4().hex
+ ref['impersonation'] = False
+ req_ref = ref.copy()
+ req_ref.pop('id')
+
+ # Note the TrustManager takes a list of role_names, and converts
+ # internally to the slightly odd list-of-dict API format, so we
+ # have to pass the expected request data to allow correct stubbing
+ ref['role_names'] = ['atestrole']
+ ref['role_ids'] = [uuid.uuid4().hex]
+ req_ref['roles'] = [{'name': 'atestrole'}, {'id': ref['role_ids'][0]}]
+ super(TrustTests, self).test_create(ref=ref, req_ref=req_ref)
+
def test_create_expires(self):
ref = self.new_ref()
ref['trustor_user_id'] = uuid.uuid4().hex