Tests stop using deprecated HTTPClient.get()

Several tests were using httpclient.HTTPClient.get(), which is
deprecated for removal. Tests that are not testing .get() need to
switch to a different method so that we can eventually remove it.

Change-Id: I757abdf2ed24d38b9064a38d33ef98a4614d6bb2
This commit is contained in:
Brant Knudson
2016-02-28 08:14:28 -06:00
parent 7d57eceb19
commit c107a05b5e
2 changed files with 7 additions and 14 deletions

View File

@@ -243,8 +243,7 @@ class AuthenticateAgainstKeystoneTests(utils.TestCase):
self.assertEqual(cl.auth_token, self.TEST_TOKEN)
# the token returned from the authentication will be used
with self.deprecations.expect_deprecations_here():
resp, body = cl.get(fake_url)
resp, body = cl._adapter.get(fake_url)
self.assertEqual(fake_resp, body)
token = self.requests_mock.last_request.headers.get('X-Auth-Token')
@@ -253,8 +252,7 @@ class AuthenticateAgainstKeystoneTests(utils.TestCase):
# then override that token and the new token shall be used
cl.auth_token = fake_token
with self.deprecations.expect_deprecations_here():
resp, body = cl.get(fake_url)
resp, body = cl._adapter.get(fake_url)
self.assertEqual(fake_resp, body)
token = self.requests_mock.last_request.headers.get('X-Auth-Token')
@@ -263,8 +261,7 @@ class AuthenticateAgainstKeystoneTests(utils.TestCase):
# if we clear that overridden token then we fall back to the original
del cl.auth_token
with self.deprecations.expect_deprecations_here():
resp, body = cl.get(fake_url)
resp, body = cl._adapter.get(fake_url)
self.assertEqual(fake_resp, body)
token = self.requests_mock.last_request.headers.get('X-Auth-Token')

View File

@@ -241,8 +241,7 @@ class AuthenticateAgainstKeystoneTests(utils.TestCase):
body = jsonutils.loads(self.requests_mock.last_request.body)
self.assertEqual(body['auth']['identity']['token']['id'], fake_token)
with self.deprecations.expect_deprecations_here():
resp, body = cl.get(fake_url)
resp, body = cl._adapter.get(fake_url)
self.assertEqual(fake_resp, body)
token = self.requests_mock.last_request.headers.get('X-Auth-Token')
@@ -348,8 +347,7 @@ class AuthenticateAgainstKeystoneTests(utils.TestCase):
self.assertEqual(cl.auth_token, self.TEST_TOKEN)
# the token returned from the authentication will be used
with self.deprecations.expect_deprecations_here():
resp, body = cl.get(fake_url)
resp, body = cl._adapter.get(fake_url)
self.assertEqual(fake_resp, body)
token = self.requests_mock.last_request.headers.get('X-Auth-Token')
@@ -358,8 +356,7 @@ class AuthenticateAgainstKeystoneTests(utils.TestCase):
# then override that token and the new token shall be used
cl.auth_token = fake_token
with self.deprecations.expect_deprecations_here():
resp, body = cl.get(fake_url)
resp, body = cl._adapter.get(fake_url)
self.assertEqual(fake_resp, body)
token = self.requests_mock.last_request.headers.get('X-Auth-Token')
@@ -368,8 +365,7 @@ class AuthenticateAgainstKeystoneTests(utils.TestCase):
# if we clear that overridden token then we fall back to the original
del cl.auth_token
with self.deprecations.expect_deprecations_here():
resp, body = cl.get(fake_url)
resp, body = cl._adapter.get(fake_url)
self.assertEqual(fake_resp, body)
token = self.requests_mock.last_request.headers.get('X-Auth-Token')