Adapt unit tests to keystoneauth 5.9.0
Since keystoneauth 5.9.0[1], LegacyJSONAdapter no longer inherits the base Adapter class. Update mocks according to that change. [1] 0383309ced09813d31150a1495b18073dc944308 Change-Id: I8495db0ca59681bb7888bb8b7b353f8b16aa42fc
This commit is contained in:
@@ -110,7 +110,7 @@ class ClientTest(utils.TestCase):
|
||||
cs = cinderclient.client.SessionClient(self, api_version='3.0')
|
||||
self.assertEqual(expected_base, cs._get_base_url())
|
||||
|
||||
@mock.patch.object(adapter.Adapter, 'request')
|
||||
@mock.patch.object(adapter.LegacyJsonAdapter, '_request')
|
||||
@mock.patch.object(exceptions, 'from_response')
|
||||
def test_sessionclient_request_method(
|
||||
self, mock_from_resp, mock_request):
|
||||
@@ -155,7 +155,7 @@ class ClientTest(utils.TestCase):
|
||||
self.assertEqual(202, response.status_code)
|
||||
self.assertFalse(mock_from_resp.called)
|
||||
|
||||
@mock.patch.object(adapter.Adapter, 'request')
|
||||
@mock.patch.object(adapter.LegacyJsonAdapter, '_request')
|
||||
def test_sessionclient_request_method_raises_badrequest(
|
||||
self, mock_request):
|
||||
kwargs = {
|
||||
@@ -193,7 +193,7 @@ class ClientTest(utils.TestCase):
|
||||
mock.sentinel.url, 'POST', **kwargs)
|
||||
self.assertIsNotNone(session_client._logger)
|
||||
|
||||
@mock.patch.object(adapter.Adapter, 'request')
|
||||
@mock.patch.object(adapter.LegacyJsonAdapter, '_request')
|
||||
def test_sessionclient_request_method_raises_overlimit(
|
||||
self, mock_request):
|
||||
resp = {
|
||||
@@ -232,7 +232,7 @@ class ClientTest(utils.TestCase):
|
||||
}
|
||||
}
|
||||
|
||||
with mock.patch.object(adapter.Adapter, 'request',
|
||||
with mock.patch.object(adapter.LegacyJsonAdapter, '_request',
|
||||
side_effect=
|
||||
keystone_exception.AuthorizationFailure()):
|
||||
session_client = cinderclient.client.SessionClient(
|
||||
|
@@ -232,7 +232,7 @@ class ShellTest(utils.TestCase):
|
||||
self.list_volumes_on_service(count)
|
||||
|
||||
@mock.patch('keystoneauth1.identity.v2.Password')
|
||||
@mock.patch('keystoneauth1.adapter.Adapter.get_token',
|
||||
@mock.patch('keystoneauth1.adapter.LegacyJsonAdapter.get_token',
|
||||
side_effect=ks_exc.ConnectFailure())
|
||||
@mock.patch('keystoneauth1.discover.Discover',
|
||||
side_effect=ks_exc.ConnectFailure())
|
||||
|
@@ -3,7 +3,7 @@
|
||||
# you find any incorrect lower bounds, let us know or propose a fix.
|
||||
pbr>=5.5.0 # Apache-2.0
|
||||
PrettyTable>=0.7.2 # BSD
|
||||
keystoneauth1>=5.0.0 # Apache-2.0
|
||||
keystoneauth1>=5.9.0 # Apache-2.0
|
||||
oslo.i18n>=5.0.1 # Apache-2.0
|
||||
oslo.utils>=4.8.0 # Apache-2.0
|
||||
requests>=2.25.1 # Apache-2.0
|
||||
|
Reference in New Issue
Block a user