Fix dependency on requests library version
The code was calling property Response.next which is only available in requests >= 2.15.0 [1]. At present minimum version of requests library is 2.14.2 in requirements.txt. Instead of bumping its version (impacts packaging specially to already released OpenStack versions), we can solve it on our side with this patch. The error was: AttributeError: 'Response' object has no attribute 'next' [1] https://github.com/requests/requests/blob/v2.15.0/HISTORY.rst Story: 2004641 Task: 28591 Change-Id: I15b496c740b0c7c8970501d08497ba43cbffda2b
This commit is contained in:
parent
842130a5b8
commit
c451ff963f
|
@ -774,6 +774,8 @@ class LoadBalancerBaseTestWithCompute(LoadBalancerBaseTest):
|
||||||
:param cookies: Optional cookies to send in the request.
|
:param cookies: Optional cookies to send in the request.
|
||||||
:param redirect: Is the request a redirect? If true, assume the passed
|
:param redirect: Is the request a redirect? If true, assume the passed
|
||||||
content should be the next URL in the chain.
|
content should be the next URL in the chain.
|
||||||
|
:param timeout: Optional seconds to wait for the server to send data.
|
||||||
|
|
||||||
:return: boolean success status
|
:return: boolean success status
|
||||||
|
|
||||||
:raises: testtools.matchers.MismatchError
|
:raises: testtools.matchers.MismatchError
|
||||||
|
@ -788,6 +790,7 @@ class LoadBalancerBaseTestWithCompute(LoadBalancerBaseTest):
|
||||||
self.assertEqual(response_code, req.status_code)
|
self.assertEqual(response_code, req.status_code)
|
||||||
if redirect:
|
if redirect:
|
||||||
self.assertTrue(req.is_redirect)
|
self.assertTrue(req.is_redirect)
|
||||||
self.assertEqual(response_content, req.next.url)
|
self.assertEqual(response_content,
|
||||||
|
session.get_redirect_target(req))
|
||||||
elif response_content:
|
elif response_content:
|
||||||
self.assertEqual(six.text_type(response_content), req.text)
|
self.assertEqual(six.text_type(response_content), req.text)
|
||||||
|
|
Loading…
Reference in New Issue