Esempio n. 1
0
 def fixture_response_connected(self, response_code):
     handle = MockCurl({pycurl.RESPONSE_CODE: response_code})
     handle.request_obj = Request(RequestTarget(self.host),
                                  RequestData(self.request))
     handle.output_buffer = io.BytesIO()
     handle.output_buffer.write(self.data)
     return Response.connection_successful(handle)
Esempio n. 2
0
 def fixture_handle(info, request, data, debug):
     handle = MockCurl(info)
     handle.request_obj = request
     handle.output_buffer = io.BytesIO()
     handle.output_buffer.write(data.encode("utf-8"))
     handle.debug_buffer = io.BytesIO()
     handle.debug_buffer.write(debug.encode("utf-8"))
     return handle