summaryrefslogtreecommitdiff
path: root/functionaltests/client/test_client_connectivity.py
diff options
context:
space:
mode:
authorDouglas Mendizábal <douglas@redrobot.io>2022-11-03 10:59:18 -0500
committerGrzegorz Grasza <xek@redhat.com>2023-01-03 16:46:09 +0000
commitb3f3912a71ff1c2e85e5c2e3bed40c744312de3d (patch)
tree3488a11a6e24f32e0ecf5ec91dc0fcc3b7012a34 /functionaltests/client/test_client_connectivity.py
parent9a457b434d16821e9449113a5835e8ce9ef26ba7 (diff)
downloadpython-barbicanclient-b3f3912a71ff1c2e85e5c2e3bed40c744312de3d.tar.gz
Implement microversions
This patch introduces a new `microversion` parameter to the factory method for the Client class. The parameter is used to set `default_microversion` in the HTTPClient. Co-Authored-By: Andre Aranha <afariasa@redhat.com> Co-Authored-By: Grzegorz Grasza <xek@redhat.com> Depends-On: https://review.opendev.org/c/openstack/keystoneauth/+/865439 Change-Id: I2a0a5315daca8ce5bd6164cebbd2f917348c7675
Diffstat (limited to 'functionaltests/client/test_client_connectivity.py')
-rw-r--r--functionaltests/client/test_client_connectivity.py32
1 files changed, 12 insertions, 20 deletions
diff --git a/functionaltests/client/test_client_connectivity.py b/functionaltests/client/test_client_connectivity.py
index 482db57..f0af575 100644
--- a/functionaltests/client/test_client_connectivity.py
+++ b/functionaltests/client/test_client_connectivity.py
@@ -70,14 +70,6 @@ class WhenTestingClientConnectivity(BaseTestCase):
self.assertRaises(exceptions.HTTPClientError, client.orders.list)
self.assertRaises(exceptions.HTTPClientError, client.secrets.list)
- def assert_client_cannot_get_endpoint(self, client):
- self.assertRaises(ks_exceptions.EndpointNotFound,
- client.containers.list)
- self.assertRaises(ks_exceptions.EndpointNotFound,
- client.orders.list)
- self.assertRaises(ks_exceptions.EndpointNotFound,
- client.secrets.list)
-
def test_can_access_server_if_endpoint_and_session_specified(self):
barbicanclient = client.Client(
endpoint=CONF.keymanager.url,
@@ -112,25 +104,27 @@ class WhenTestingClientConnectivity(BaseTestCase):
self.assert_client_can_contact_barbican(barbicanclient)
def test_client_cannot_access_server_if_endpoint_filter_wrong(self):
- barbicanclient = client.Client(
+ self.assertRaises(
+ ks_exceptions.EndpointNotFound,
+ client.Client,
project_id=CONF.keymanager.project_id,
auth=self.auth,
interface=client._DEFAULT_SERVICE_INTERFACE,
service_type='wrong-service-type',
version=client._DEFAULT_API_VERSION)
- self.assert_client_cannot_get_endpoint(barbicanclient)
-
- barbicanclient = client.Client(
+ self.assertRaises(
+ ks_exceptions.EndpointNotFound,
+ client.Client,
project_id=CONF.keymanager.project_id,
auth=self.auth,
interface='wrong-interface',
service_type=client._DEFAULT_SERVICE_TYPE,
version=client._DEFAULT_API_VERSION)
- self.assert_client_cannot_get_endpoint(barbicanclient)
-
- barbicanclient = client.Client(
+ self.assertRaises(
+ ks_exceptions.EndpointNotFound,
+ client.Client,
project_id=CONF.keymanager.project_id,
auth=self.auth,
interface=client._DEFAULT_SERVICE_INTERFACE,
@@ -138,9 +132,9 @@ class WhenTestingClientConnectivity(BaseTestCase):
service_name='wrong-service-name',
version=client._DEFAULT_API_VERSION)
- self.assert_client_cannot_get_endpoint(barbicanclient)
-
- barbicanclient = client.Client(
+ self.assertRaises(
+ ks_exceptions.EndpointNotFound,
+ client.Client,
project_id=CONF.keymanager.project_id,
auth=self.auth,
interface=client._DEFAULT_SERVICE_INTERFACE,
@@ -148,8 +142,6 @@ class WhenTestingClientConnectivity(BaseTestCase):
region_name='wrong-region-name',
version=client._DEFAULT_API_VERSION)
- self.assert_client_cannot_get_endpoint(barbicanclient)
-
def test_cannot_create_client_if_nonexistent_version_specified(self):
self.assertRaises(exceptions.UnsupportedVersion,
client.Client,