Skip to content

Commit 916bb68

Browse files
author
Dean Troyer
committed
Add to clientmanager tests
Change-Id: Iea59c494f31de9c3e1d662f89e6e2babcc8fbd61
1 parent 44c97cc commit 916bb68

1 file changed

Lines changed: 24 additions & 1 deletion

File tree

‎openstackclient/tests/common/test_clientmanager.py‎

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2012-2013 OpenStack, LLC.
1+
# Copyright 2012-2013 OpenStack Foundation
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License"); you may
44
# not use this file except in compliance with the License. You may obtain
@@ -17,6 +17,10 @@
1717
from openstackclient.tests import utils
1818

1919

20+
AUTH_TOKEN = "foobar"
21+
AUTH_URL = "http://0.0.0.0"
22+
23+
2024
class Container(object):
2125
attr = clientmanager.ClientCache(lambda x: object())
2226

@@ -28,8 +32,27 @@ class TestClientManager(utils.TestCase):
2832
def setUp(self):
2933
super(TestClientManager, self).setUp()
3034

35+
api_version = {"identity": "2.0"}
36+
37+
self.client_manager = clientmanager.ClientManager(
38+
token=AUTH_TOKEN,
39+
url=AUTH_URL,
40+
auth_url=AUTH_URL,
41+
api_version=api_version,
42+
)
43+
3144
def test_singleton(self):
3245
# NOTE(dtroyer): Verify that the ClientCache descriptor only invokes
3346
# the factory one time and always returns the same value after that.
3447
c = Container()
3548
self.assertEqual(c.attr, c.attr)
49+
50+
def test_make_client_identity_default(self):
51+
self.assertEqual(
52+
self.client_manager.identity.auth_token,
53+
AUTH_TOKEN,
54+
)
55+
self.assertEqual(
56+
self.client_manager.identity.management_url,
57+
AUTH_URL,
58+
)

0 commit comments

Comments
 (0)