make httpretty fork closed to upstream
This commit is contained in:
parent
46e31d1ecc
commit
5bec85c6c0
@ -277,7 +277,9 @@ class fakesock(object):
|
|||||||
# if self._host not in hostnames:
|
# if self._host not in hostnames:
|
||||||
# return self._true_sendall(data)
|
# return self._true_sendall(data)
|
||||||
|
|
||||||
|
import pdb;pdb.set_trace()
|
||||||
if not is_parsing_headers:
|
if not is_parsing_headers:
|
||||||
|
|
||||||
if len(self._sent_data) > 1:
|
if len(self._sent_data) > 1:
|
||||||
headers, body = map(utf8, self._sent_data[-2:])
|
headers, body = map(utf8, self._sent_data[-2:])
|
||||||
|
|
||||||
@ -292,7 +294,7 @@ class fakesock(object):
|
|||||||
# If we are sending more data to a dynamic response entry,
|
# If we are sending more data to a dynamic response entry,
|
||||||
# we need to call the method again.
|
# we need to call the method again.
|
||||||
if self._entry and self._entry.dynamic_response:
|
if self._entry and self._entry.dynamic_response:
|
||||||
self._entry.body(info, body, headers)
|
self._entry.body(info, method, body, headers)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return HTTPretty.historify_request(headers, body, False)
|
return HTTPretty.historify_request(headers, body, False)
|
||||||
@ -328,7 +330,7 @@ class fakesock(object):
|
|||||||
entry = matcher.get_next_entry()
|
entry = matcher.get_next_entry()
|
||||||
if entry.method == method:
|
if entry.method == method:
|
||||||
self._entry = entry
|
self._entry = entry
|
||||||
self._request = (info, body, headers)
|
self._request = (info, method, body, headers)
|
||||||
else:
|
else:
|
||||||
raise ValueError("No match found for", method, entry.uri)
|
raise ValueError("No match found for", method, entry.uri)
|
||||||
|
|
||||||
@ -531,7 +533,7 @@ class Entry(Py3kObject):
|
|||||||
return new
|
return new
|
||||||
|
|
||||||
def fill_filekind(self, fk, request):
|
def fill_filekind(self, fk, request):
|
||||||
req_info, req_body, req_headers = request
|
req_info, method, req_body, req_headers = request
|
||||||
|
|
||||||
now = datetime.utcnow()
|
now = datetime.utcnow()
|
||||||
|
|
||||||
@ -543,7 +545,7 @@ class Entry(Py3kObject):
|
|||||||
}
|
}
|
||||||
|
|
||||||
if self.dynamic_response:
|
if self.dynamic_response:
|
||||||
response = self.body(req_info, req_body, req_headers)
|
response = self.body(req_info, method, req_body, req_headers)
|
||||||
if isinstance(response, basestring):
|
if isinstance(response, basestring):
|
||||||
body = response
|
body = response
|
||||||
new_headers = {}
|
new_headers = {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user