Package googleapiclient :: Module http :: Class HttpRequestMock |
[hide private]
[frames] | no frames]

# Class HttpRequestMock

source code

    Mock of HttpRequest.

    Do not construct directly, instead use RequestMockBuilder.

Instance Methods | [hide private]
__init__(self, resp, content, postproc) Constructor for HttpRequestMock | source code
execute(self, http=None) Execute the request. | source code
Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Properties | [hide private]
Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, resp, content, postproc) (Constructor) | source code
    Constructor for HttpRequestMock

    Args:
      resp: httplib2.Response, the response to emulate coming from the request
      content: string, the response body
      postproc: callable, the post processing function usually supplied by
                the model class. See model.JsonModel.response() as an example.
Overrides: object.__init__

### execute(self, http=None) | source code
    Execute the request.

    Same behavior as HttpRequest.execute(), but the response is
    mocked and not really from an HTTP request/response.