class documentation
class WSGITestsMixin: (source)
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
Method | get |
Undocumented |
Method | low |
No summary |
Method | prepare |
Prepare a Request which, when a request is received, captures the environ and start_response callable passed to a WSGI app. |
Method | render |
Undocumented |
Method | request |
Undocumented |
Method | set |
Undocumented |
Instance Variable | channel |
A no-argument callable which will be invoked to create a new HTTP channel to associate with request objects. |
Instance Variable | reactor |
Undocumented |
Instance Variable | threadpool |
Undocumented |
def lowLevelRender(self, requestFactory, applicationFactory, channelFactory, method, version, resourceSegments, requestSegments, query=None, headers=[], body=None, safe=''):
(source)
¶
Parameters | |
request | Undocumented |
application | Undocumented |
channel | Undocumented |
method | A str giving the request method to use. |
version | A str like '1.1' giving the request version. |
resource | 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. |
request | 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. |
body | Undocumented |
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. |
overridden in
twisted.web.test.test_wsgi.EnvironTests
A no-argument callable which will be invoked to create a new HTTP channel to associate with request objects.