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:
parent
d281bd2546
commit
1f8b4fe443
@ -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
|
||||
|
||||
|
@ -1298,8 +1298,11 @@ class CommonAuthTokenMiddlewareTest(object):
|
||||
self.assertThat(1, matchers.Equals(cache.set.call_count))
|
||||
|
||||
def test_auth_plugin(self):
|
||||
|
||||
for service_url in (self.examples.UNVERSIONED_SERVICE_URL,
|
||||
self.examples.SERVICE_URL):
|
||||
httpretty.register_uri(httpretty.GET,
|
||||
self.examples.SERVICE_URL,
|
||||
service_url,
|
||||
body=VERSION_LIST_v3,
|
||||
status_code=300)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user