summaryrefslogtreecommitdiff
path: root/keystoneclient/fixture
diff options
context:
space:
mode:
authorJamie Lennox <jamielennox@redhat.com>2015-03-28 15:03:19 +1100
committerJamie Lennox <jamielennox@redhat.com>2015-07-25 09:51:42 +0000
commit6950527f09f759c44ef145bde71d600a4066daf7 (patch)
tree7ed3ba3dab6befc595b46f3bc5f9eda0558d5470 /keystoneclient/fixture
parent610844d06db5b2af93c0747a7690c44d3724510b (diff)
downloadpython-keystoneclient-6950527f09f759c44ef145bde71d600a4066daf7.tar.gz
Use UUID values in v3 test fixtures
The fixtures will automatically stub UUID values for required token fields, so we can check for those returned values rather than specify fixed string values. Change-Id: I8a6cc675c6c8ee14772a38d8fc38475885ebc605
Diffstat (limited to 'keystoneclient/fixture')
-rw-r--r--keystoneclient/fixture/v3.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/keystoneclient/fixture/v3.py b/keystoneclient/fixture/v3.py
index bda5e19..d27a93b 100644
--- a/keystoneclient/fixture/v3.py
+++ b/keystoneclient/fixture/v3.py
@@ -325,6 +325,14 @@ class Token(dict):
def audit_chain_id(self, value):
self.root['audit_ids'] = [self.audit_id, value]
+ @property
+ def role_ids(self):
+ return [r['id'] for r in self.root.get('roles', [])]
+
+ @property
+ def role_names(self):
+ return [r['name'] for r in self.root.get('roles', [])]
+
def validate(self):
project = self.root.get('project')
domain = self.root.get('domain')