summaryrefslogtreecommitdiff
path: root/novaclient/tests/unit/v2/test_client.py
diff options
context:
space:
mode:
Diffstat (limited to 'novaclient/tests/unit/v2/test_client.py')
-rw-r--r--novaclient/tests/unit/v2/test_client.py45
1 files changed, 45 insertions, 0 deletions
diff --git a/novaclient/tests/unit/v2/test_client.py b/novaclient/tests/unit/v2/test_client.py
new file mode 100644
index 0000000..b4c59ce
--- /dev/null
+++ b/novaclient/tests/unit/v2/test_client.py
@@ -0,0 +1,45 @@
1# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12
13import uuid
14
15from keystoneclient import session
16
17from novaclient.tests.unit import utils
18from novaclient.v2 import client
19
20
21class ClientTest(utils.TestCase):
22
23 def test_adapter_properties(self):
24 # sample of properties, there are many more
25 user_agent = uuid.uuid4().hex
26 endpoint_override = uuid.uuid4().hex
27
28 s = session.Session()
29 c = client.Client(session=s,
30 user_agent=user_agent,
31 endpoint_override=endpoint_override)
32
33 self.assertEqual(user_agent, c.client.user_agent)
34 self.assertEqual(endpoint_override, c.client.endpoint_override)
35
36 def test_passing_interface(self):
37 endpoint_type = uuid.uuid4().hex
38 interface = uuid.uuid4().hex
39
40 s = session.Session()
41 c = client.Client(session=s,
42 interface=interface,
43 endpoint_type=endpoint_type)
44
45 self.assertEqual(interface, c.client.interface)