예제 #1
0
 def _make_request(self, *args, **kwargs):
     httplib_response = httplib.HTTPResponse(MockSock)
     httplib_response.fp = MockChunkedEncodingResponse(
         [b'f', b'o', b'o'])
     httplib_response.headers = httplib_response.msg = HTTPHeaderDict(
     )
     return httplib_response
예제 #2
0
 def __call__(self, *args, **kwargs):
     if self._ex:
         ex, self._ex = self._ex, None
         raise ex()
     response = httplib.HTTPResponse(MockSock)
     response.fp = MockChunkedEncodingResponse([b'f', b'o', b'o'])
     response.headers = response.msg = HTTPHeaderDict()
     return response