module documentation

In-memory version of treq for testing.

Class HasHeaders Since Twisted adds headers to a request, such as the host and the content length, it's necessary to test whether request headers CONTAIN the expected headers (the ones that are not automatically added by Twisted).
Class RequestSequence For an example usage, see :meth:`RequestSequence.consume`.
Class RequestTraversalAgent :obj:`~twisted.web.iweb.IAgent` implementation that issues an in-memory request rather than going out to a real network socket.
Class StringStubbingResource A resource that takes a callable with 5 parameters ``(method, url, params, headers, data)`` and returns ``(code, headers, body)``.
Class StubTreq A fake version of the treq module that can be used for testing that provides all the function calls exposed in :obj:`treq.__all__`.
Class _EndpointFactory An endpoint factory used by :class:`RequestTraversalAgent`.
Class _SynchronousProducer A partial implementation of an :obj:`IBodyProducer` which produces its entire payload immediately. There is no way to access to an instance of this object from :obj:`RequestTraversalAgent` or :obj:`StubTreq`, or even a :obj:`Resource: passed to :obj:`StubTreq`.
Function _maybeEncode Encode `someStr` to ASCII if required.
Function _maybeEncodeHeaders Convert a headers mapping to its bytes-encoded form.
Function _reject_files Decorator that rejects the 'files' keyword argument to the request functions, because that is not handled by this yet.
def _maybeEncode(someStr): (source)

Encode `someStr` to ASCII if required.

def _maybeEncodeHeaders(headers): (source)

Convert a headers mapping to its bytes-encoded form.

def _reject_files(f): (source)

Decorator that rejects the 'files' keyword argument to the request functions, because that is not handled by this yet.