Remove keystoneclient exception usage in tests

This change replaces the usage of keystoneclient exceptions in the
auth_token_middleware unit tests to use the ConnectFailure exception
from keystoneauth.

This is part of the process of removing keystoneclient from
keystonemiddleware.

Change-Id: Ie00fc310728c319faf2cfdfb651f0c7a8f48d757
This commit is contained in:
Gage Hugo 2019-11-24 00:12:24 -06:00
parent 19f2791082
commit d3090bfbc0
1 changed files with 2 additions and 3 deletions

View File

@ -22,7 +22,6 @@ from keystoneauth1 import exceptions as ksa_exceptions
from keystoneauth1 import fixture
from keystoneauth1 import loading
from keystoneauth1 import session
from keystoneclient import exceptions as ksc_exceptions
import mock
import oslo_cache
from oslo_log import log as logging
@ -1527,7 +1526,7 @@ class DelayedAuthTests(BaseAuthTokenMiddlewareTest):
if request.headers.get('X-Subject-Token') == ERROR_TOKEN:
msg = 'Network connection refused.'
raise ksc_exceptions.ConnectionRefused(msg)
raise ksa_exceptions.ConnectFailure(msg)
# All others just fail
context.status_code = 404
@ -1951,7 +1950,7 @@ class v3CompositeAuthTests(BaseAuthTokenMiddlewareTest,
if token_id == ERROR_TOKEN:
msg = "Network connection refused."
raise ksc_exceptions.ConnectionRefused(msg)
raise ksa_exceptions.ConnectFailure(msg)
elif token_id == TIMEOUT_TOKEN:
request_timeout_response(request, context)