Merge "Update to _response_handler"
This commit is contained in:
commit
892cd41f94
@ -509,13 +509,14 @@ class Jenkins(object):
|
||||
|
||||
headers = response.headers
|
||||
if (headers.get('content-length') is None and
|
||||
headers.get('transfer-encoding') is None):
|
||||
headers.get('transfer-encoding') is None and
|
||||
(response.content is None or len(response.content) <= 0)):
|
||||
# response body should only exist if one of these is provided
|
||||
raise EmptyResponseException(
|
||||
"Error communicating with server[%s]: "
|
||||
"empty response" % self.server)
|
||||
|
||||
# Reponse objects will automatically return unicode encoded
|
||||
# Response objects will automatically return unicode encoded
|
||||
# when accessing .text property
|
||||
return response
|
||||
|
||||
|
@ -102,5 +102,6 @@ def build_response_mock(status_code, json_body=None, headers=None, **kwargs):
|
||||
# for some reason, wraps cannot handle attributes which are dicts
|
||||
# and accessed by key
|
||||
response.headers = real_response.headers
|
||||
response.content = text
|
||||
|
||||
return response
|
||||
|
Loading…
x
Reference in New Issue
Block a user