From 5bec85c6c04a2ab3b238e9212883b0d12499b8e7 Mon Sep 17 00:00:00 2001 From: Steve Pulec Date: Sun, 17 Mar 2013 18:10:31 -0400 Subject: [PATCH] make httpretty fork closed to upstream --- moto/packages/httpretty.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/moto/packages/httpretty.py b/moto/packages/httpretty.py index dc042d1e2..10ba5d784 100644 --- a/moto/packages/httpretty.py +++ b/moto/packages/httpretty.py @@ -277,7 +277,9 @@ class fakesock(object): # if self._host not in hostnames: # return self._true_sendall(data) + import pdb;pdb.set_trace() if not is_parsing_headers: + if len(self._sent_data) > 1: 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, # we need to call the method again. if self._entry and self._entry.dynamic_response: - self._entry.body(info, body, headers) + self._entry.body(info, method, body, headers) try: return HTTPretty.historify_request(headers, body, False) @@ -328,7 +330,7 @@ class fakesock(object): entry = matcher.get_next_entry() if entry.method == method: self._entry = entry - self._request = (info, body, headers) + self._request = (info, method, body, headers) else: raise ValueError("No match found for", method, entry.uri) @@ -531,7 +533,7 @@ class Entry(Py3kObject): return new def fill_filekind(self, fk, request): - req_info, req_body, req_headers = request + req_info, method, req_body, req_headers = request now = datetime.utcnow() @@ -543,7 +545,7 @@ class Entry(Py3kObject): } 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): body = response new_headers = {}