Home | Trees | Indices | Help |
---|
|
object --+ | HttpMockSequence
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 Fri Oct 2 20:46:22 2020 | http://epydoc.sourceforge.net |