Undocumented
Class | Client |
This class allows you to send requests to a wrapped application. |
Class | ClientRedirectError |
If a redirect loop is detected when using follow_redirects=True with the :cls:`Client`, then this exception is raised. |
Class | EnvironBuilder |
This class can be used to conveniently create a WSGI environment for testing purposes. It can be used to quickly create WSGI environments or request objects from arbitrary data. |
Class | TestResponse |
~werkzeug.wrappers.Response subclass that provides extra information about requests made with the test Client . |
Function | create_environ |
No summary |
Function | encode_multipart |
Like stream_encode_multipart but returns a tuple in the form (boundary, data) where data is bytes. |
Function | run_wsgi_app |
Return a tuple in the form (app_iter, status, headers) of the application output. This works best if you pass it an application that returns an iterator all the time. |
Function | stream_encode_multipart |
Encode a dict of values (either strings or file descriptors or FileStorage objects.) into a multipart encoded string stored in a file descriptor. |
Class | _TestCookieHeaders |
A headers adapter for cookielib |
Class | _TestCookieJar |
A cookielib.CookieJar modified to inject and read cookie headers from and to wsgi environments, and wsgi application responses. |
Class | _TestCookieResponse |
Something that looks like a httplib.HTTPResponse, but is actually just an adapter for our test responses to make them available for cookielib. |
Function | _iter_data |
Iterate over a mapping that might have a list of values, yielding all key, value pairs. Almost like iter_multi_items but only allows lists, not tuples, of values so tuples can be used for files. |
Variable | _TAnyMultiDict |
Undocumented |
Create a new WSGI environ dict based on the values passed. The first parameter should be the path of the request which defaults to '/'. The second one can either be an absolute path (in that case the host is localhost:80) or a full path to the request with scheme, netloc port and the path to the script.
This accepts the same arguments as the EnvironBuilder
constructor.
EnvironBuilder
which
was added in 0.5. The headers
, environ_base
, environ_overrides
and charset
parameters were added.Parameters | |
*args:t.Any | Undocumented |
**kwargs:t.Any | Undocumented |
Returns | |
WSGIEnvironment | Undocumented |
stream_encode_multipart
but returns a tuple in the form
(boundary, data) where data is bytes.Parameters | |
values:t.Mapping[ | Undocumented |
boundary:t.Optional[ | Undocumented |
charset:str | Undocumented |
Returns | |
t.Tuple[ | Undocumented |
Return a tuple in the form (app_iter, status, headers) of the application output. This works best if you pass it an application that returns an iterator all the time.
Sometimes applications may use the write()
callable returned
by the start_response
function. This tries to resolve such edge
cases automatically. But if you don't get the expected output you
should set buffered
to True
which enforces buffering.
If passed an invalid WSGI application the behavior of this function is undefined. Never pass non-conforming WSGI applications to this function.
Parameters | |
app:WSGIApplication | the application to execute. |
environ:WSGIEnvironment | Undocumented |
buffered:bool | set to True to enforce buffering. |
Returns | |
t.Tuple[ | tuple in the form (app_iter, status, headers) |
FileStorage
objects.) into a multipart encoded string stored
in a file descriptor.Parameters | |
data:t.Mapping[ | Undocumented |
use_tempfile:bool | Undocumented |
threshold:int | Undocumented |
boundary:t.Optional[ | Undocumented |
charset:str | Undocumented |
Returns | |
t.Tuple[ | Undocumented |
Parameters | |
data:t.Mapping[ | Undocumented |
Returns | |
t.Iterator[ | Undocumented |