e0174b51bd
This prevents clients of the pythonic api from having to know the internal module structure. Change-Id: Idd5c522ac3ff6c2d7915f96ed327323ec83d54fc
27 lines
824 B
Python
27 lines
824 B
Python
|
|
import novaclient.client
|
|
import novaclient.v1_1.client
|
|
from tests import utils
|
|
|
|
|
|
class ClientTest(utils.TestCase):
|
|
|
|
def setUp(self):
|
|
pass
|
|
|
|
def test_get_client_class_v2(self):
|
|
output = novaclient.client.get_client_class('2')
|
|
self.assertEqual(output, novaclient.v1_1.client.Client)
|
|
|
|
def test_get_client_class_v2_int(self):
|
|
output = novaclient.client.get_client_class(2)
|
|
self.assertEqual(output, novaclient.v1_1.client.Client)
|
|
|
|
def test_get_client_class_v1_1(self):
|
|
output = novaclient.client.get_client_class('1.1')
|
|
self.assertEqual(output, novaclient.v1_1.client.Client)
|
|
|
|
def test_get_client_class_unknown(self):
|
|
self.assertRaises(novaclient.exceptions.UnsupportedVersion,
|
|
novaclient.client.get_client_class, '0')
|