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:
parent
19f2791082
commit
d3090bfbc0
|
@ -22,7 +22,6 @@ from keystoneauth1 import exceptions as ksa_exceptions
|
||||||
from keystoneauth1 import fixture
|
from keystoneauth1 import fixture
|
||||||
from keystoneauth1 import loading
|
from keystoneauth1 import loading
|
||||||
from keystoneauth1 import session
|
from keystoneauth1 import session
|
||||||
from keystoneclient import exceptions as ksc_exceptions
|
|
||||||
import mock
|
import mock
|
||||||
import oslo_cache
|
import oslo_cache
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
|
@ -1527,7 +1526,7 @@ class DelayedAuthTests(BaseAuthTokenMiddlewareTest):
|
||||||
|
|
||||||
if request.headers.get('X-Subject-Token') == ERROR_TOKEN:
|
if request.headers.get('X-Subject-Token') == ERROR_TOKEN:
|
||||||
msg = 'Network connection refused.'
|
msg = 'Network connection refused.'
|
||||||
raise ksc_exceptions.ConnectionRefused(msg)
|
raise ksa_exceptions.ConnectFailure(msg)
|
||||||
|
|
||||||
# All others just fail
|
# All others just fail
|
||||||
context.status_code = 404
|
context.status_code = 404
|
||||||
|
@ -1951,7 +1950,7 @@ class v3CompositeAuthTests(BaseAuthTokenMiddlewareTest,
|
||||||
|
|
||||||
if token_id == ERROR_TOKEN:
|
if token_id == ERROR_TOKEN:
|
||||||
msg = "Network connection refused."
|
msg = "Network connection refused."
|
||||||
raise ksc_exceptions.ConnectionRefused(msg)
|
raise ksa_exceptions.ConnectFailure(msg)
|
||||||
elif token_id == TIMEOUT_TOKEN:
|
elif token_id == TIMEOUT_TOKEN:
|
||||||
request_timeout_response(request, context)
|
request_timeout_response(request, context)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue