twisted.web.test.test_wsgi.WSGITestsMixin
class documentationtwisted.web.test.test_wsgi
(View In Hierarchy)
Known subclasses: twisted.web.test.test_wsgi.ApplicationTests, twisted.web.test.test_wsgi.EnvironTests, twisted.web.test.test_wsgi.InputStreamTestMixin, twisted.web.test.test_wsgi.StartResponseTests
Instance Variable | channelFactory | A no-argument callable which will be invoked to create a new HTTP channel to associate with request objects. |
Method | setUp | Undocumented |
Method | lowLevelRender | |
Method | render | Undocumented |
Method | requestFactoryFactory | Undocumented |
Method | getContentFromResponse | Undocumented |
Method | prepareRequest | Prepare a Request which, when
a request is received, captures the environ and
start_response callable passed to a WSGI app. |
Parameters | method | A str giving the request method to use. |
version | A str like '1.1' giving the request version. | |
resourceSegments | A list of unencoded path segments which specifies the location
in the resource hierarchy at which the WSGIResource
will be placed, eg [''] for /, ['foo', 'bar',
''] for /foo/bar/, etc. | |
requestSegments | A list of unencoded path segments giving the request URI. | |
query | A list of two-tuples of str giving unencoded
query argument keys and values. | |
headers | A list of two-tuples of str giving request header
names and corresponding values. | |
safe | A str giving the bytes which are to be considered safe
for inclusion in the request URI and not quoted. | |
Returns | A Deferred
which will be called back with a two-tuple of the arguments passed which
would be passed to the WSGI application object for this configuration and
request (ie, the environment and start_response callable). |
Prepare a Request
which, when
a request is received, captures the environ
and
start_response
callable passed to a WSGI app.
Parameters | application | An optional WSGI application callable that accepts the familiar
environ and start_response args and returns an
iterable of body content. If not supplied, start_response will
be called with a "200 OK" status and no headers, and no content
will be yielded. |
Returns | A two-tuple of (request , deferred ). The former is
a Twisted Request . The latter
is a Deferred which
will be called back with a two-tuple of the arguments passed to a WSGI
application (i.e. the environ and start_response
callable), or will errback with any error arising within the WSGI app. |