Home | Trees | Indices | Help |
---|
|
Mock of httplib2.Http Mocks a sequence of calls to request returning different responses for each call. Create an instance initialized with the desired response headers and content and then use as if an httplib2.Http instance. http = HttpMockSequence([ ({'status': '401'}, ''), ({'status': '200'}, '{"access_token":"1/3w","expires_in":3600}'), ({'status': '200'}, 'echo_request_headers'), ]) resp, content = http.request("http://examples.com") There are special values you can pass in for content to trigger behavours that are helpful in testing. 'echo_request_headers' means return the request headers in the response body 'echo_request_headers_as_json' means return the request headers in the response body 'echo_request_body' means return the request body in the response body 'echo_request_uri' means return the request uri in the response body
|
|||
|
|||
|
|||
Inherited from |
|
|||
Inherited from |
|
Args: iterable: iterable, a sequence of pairs of (headers, body)
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Mon Jun 5 13:38:40 2017 | http://epydoc.sourceforge.net |