summaryrefslogtreecommitdiff
path: root/openstackclient/tests/fakes.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-06-13 15:39:36 +0000
committerGerrit Code Review <review@openstack.org>2016-06-13 15:39:36 +0000
commit17627c55956bca21ddb601fb2604579d0fbb9c9b (patch)
tree8b52c88dc4529fd5714fc2b783cb3e83b9d38711 /openstackclient/tests/fakes.py
parenta84a90592bb680a63ecfc0b0957e6066b161f375 (diff)
parent6ae0d2e8a54fd5139e63a990ab4bdce634e73c5e (diff)
downloadpython-openstackclient-17627c55956bca21ddb601fb2604579d0fbb9c9b.tar.gz
Merge "Moving authentication from keystoneclient to keystoneauth"
Diffstat (limited to 'openstackclient/tests/fakes.py')
-rw-r--r--openstackclient/tests/fakes.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/openstackclient/tests/fakes.py b/openstackclient/tests/fakes.py
index ad4705a4..d0cab019 100644
--- a/openstackclient/tests/fakes.py
+++ b/openstackclient/tests/fakes.py
@@ -50,6 +50,21 @@ TEST_RESPONSE_DICT_V3.set_project_scope()
TEST_VERSIONS = fixture.DiscoveryList(href=AUTH_URL)
+def to_unicode_dict(catalog_dict):
+ """Converts dict to unicode dict
+
+ """
+ if isinstance(catalog_dict, dict):
+ return {to_unicode_dict(key): to_unicode_dict(value)
+ for key, value in catalog_dict.items()}
+ elif isinstance(catalog_dict, list):
+ return [to_unicode_dict(element) for element in catalog_dict]
+ elif isinstance(catalog_dict, str):
+ return catalog_dict + u""
+ else:
+ return catalog_dict
+
+
class FakeStdout(object):
def __init__(self):