summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrant Knudson <bknudson@us.ibm.com>2014-09-21 17:22:04 -0500
committerBrant Knudson <bknudson@us.ibm.com>2014-09-21 17:49:24 -0500
commit1f8b4fe4432c7725ed3ac630ab07990ff9a48d17 (patch)
tree56c94e14686be0324268995caf0e50b95fdbef72
parentd281bd25461eda49963522a5bf2583b84bb7d147 (diff)
downloadkeystonemiddleware-1f8b4fe4432c7725ed3ac630ab07990ff9a48d17.tar.gz
Fix test failure after discovery hack
With the discovery hack, the test_auth_plugin is now trying to query the unversioned endpoint from the catalog to discover what versions it supports. Since that URL wasn't stubbed out with httpretty it was causing a failure and then a different URL than expected was returned by the plugin. This change registers the discovery URL that's in the test token so that fetching it doesn't fail but returns a normal version response. Related-Bug: #1335726 Closes-Bug: #1372190 Change-Id: I1ae41801ed44ec6a37d972f62fc853dfd609128f
-rw-r--r--keystonemiddleware/tests/client_fixtures.py3
-rw-r--r--keystonemiddleware/tests/test_auth_token_middleware.py11
2 files changed, 9 insertions, 5 deletions
diff --git a/keystonemiddleware/tests/client_fixtures.py b/keystonemiddleware/tests/client_fixtures.py
index 0115e4a..84e5edc 100644
--- a/keystonemiddleware/tests/client_fixtures.py
+++ b/keystonemiddleware/tests/client_fixtures.py
@@ -236,7 +236,8 @@ class Examples(fixtures.Fixture):
ROLE_NAME2 = 'role2'
self.SERVICE_TYPE = 'identity'
- self.SERVICE_URL = 'http://keystone.server:5000/v2.0'
+ self.UNVERSIONED_SERVICE_URL = 'http://keystone.server:5000/'
+ self.SERVICE_URL = self.UNVERSIONED_SERVICE_URL + 'v2.0'
# Old Tokens
diff --git a/keystonemiddleware/tests/test_auth_token_middleware.py b/keystonemiddleware/tests/test_auth_token_middleware.py
index bd3bf8b..5462281 100644
--- a/keystonemiddleware/tests/test_auth_token_middleware.py
+++ b/keystonemiddleware/tests/test_auth_token_middleware.py
@@ -1298,10 +1298,13 @@ class CommonAuthTokenMiddlewareTest(object):
self.assertThat(1, matchers.Equals(cache.set.call_count))
def test_auth_plugin(self):
- httpretty.register_uri(httpretty.GET,
- self.examples.SERVICE_URL,
- body=VERSION_LIST_v3,
- status_code=300)
+
+ for service_url in (self.examples.UNVERSIONED_SERVICE_URL,
+ self.examples.SERVICE_URL):
+ httpretty.register_uri(httpretty.GET,
+ service_url,
+ body=VERSION_LIST_v3,
+ status_code=300)
req = webob.Request.blank('/')
req.headers['X-Auth-Token'] = self.token_dict['uuid_token_default']