summaryrefslogtreecommitdiff
path: root/openstackclient/tests
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-10-13 04:56:22 +0000
committerGerrit Code Review <review@openstack.org>2013-10-13 04:56:22 +0000
commitb3fd6ad6db2de478f44b8e892996648636deb1fb (patch)
tree85edbb10dac0c082b2fac4d901693aa927d9fb94 /openstackclient/tests
parent3f9c68f1c6585c1d7f31b75c8719efc47230d86f (diff)
parent916bb68dfdedcd977c9d88fad650c440b8f6a449 (diff)
downloadpython-openstackclient-b3fd6ad6db2de478f44b8e892996648636deb1fb.tar.gz
Merge "Add to clientmanager tests"
Diffstat (limited to 'openstackclient/tests')
-rw-r--r--openstackclient/tests/common/test_clientmanager.py25
1 files changed, 24 insertions, 1 deletions
diff --git a/openstackclient/tests/common/test_clientmanager.py b/openstackclient/tests/common/test_clientmanager.py
index 395f6ec3..6aee711d 100644
--- a/openstackclient/tests/common/test_clientmanager.py
+++ b/openstackclient/tests/common/test_clientmanager.py
@@ -1,4 +1,4 @@
-# Copyright 2012-2013 OpenStack, LLC.
+# Copyright 2012-2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
@@ -17,6 +17,10 @@ from openstackclient.common import clientmanager
from openstackclient.tests import utils
+AUTH_TOKEN = "foobar"
+AUTH_URL = "http://0.0.0.0"
+
+
class Container(object):
attr = clientmanager.ClientCache(lambda x: object())
@@ -28,8 +32,27 @@ class TestClientManager(utils.TestCase):
def setUp(self):
super(TestClientManager, self).setUp()
+ api_version = {"identity": "2.0"}
+
+ self.client_manager = clientmanager.ClientManager(
+ token=AUTH_TOKEN,
+ url=AUTH_URL,
+ auth_url=AUTH_URL,
+ api_version=api_version,
+ )
+
def test_singleton(self):
# NOTE(dtroyer): Verify that the ClientCache descriptor only invokes
# the factory one time and always returns the same value after that.
c = Container()
self.assertEqual(c.attr, c.attr)
+
+ def test_make_client_identity_default(self):
+ self.assertEqual(
+ self.client_manager.identity.auth_token,
+ AUTH_TOKEN,
+ )
+ self.assertEqual(
+ self.client_manager.identity.management_url,
+ AUTH_URL,
+ )