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
This commit is contained in:
Brant Knudson 2014-09-21 17:22:04 -05:00
parent d281bd2546
commit 1f8b4fe443
2 changed files with 9 additions and 5 deletions

View File

@ -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

View File

@ -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']