Undocumented
Class |
|
This class allows you to send requests to a wrapped application. |
Class |
|
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 |
|
:class:`~werkzeug.wrappers.Response` subclass that provides extra information about requests made with the test :class:`Client`. |
Exception |
|
If a redirect loop is detected when using follow_redirects=True with the :cls:`Client`, then this exception is raised. |
Function | create |
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. |
Function | encode |
Like `stream_encode_multipart` but returns a tuple in the form (``boundary``, ``data``) where data is bytes. |
Function | run |
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 a dict of values (either strings or file descriptors or :class:`FileStorage` objects.) into a multipart encoded string stored in a file descriptor. |
Class | _ |
A headers adapter for cookielib |
Class | _ |
A cookielib.CookieJar modified to inject and read cookie headers from and to wsgi environments, and wsgi application responses. |
Class | _ |
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 |
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. |
Type Variable | _ |
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 :class:`EnvironBuilder` constructor. .. versionchanged:: 0.5 This function is now a thin wrapper over :class:`EnvironBuilder` which was added in 0.5. The `headers`, `environ_base`, `environ_overrides` and `charset` parameters were added.
t.Mapping[ str, t.Any]
, boundary: t.Optional[ str]
= None, charset: str
= 'utf-8') -> t.Tuple[ str, bytes]
:
(source)
¶
Like `stream_encode_multipart` but returns a tuple in the form (``boundary``, ``data``) where data is bytes.
WSGIApplication
, environ: WSGIEnvironment
, buffered: bool
= False) -> t.Tuple[ t.Iterable[ bytes], str, Headers]
:
(source)
¶
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. :param app: the application to execute. :param buffered: set to `True` to enforce buffering. :return: tuple in the form ``(app_iter, status, headers)``
t.Mapping[ str, t.Any]
, use_tempfile: bool
= True, threshold: int
= 1024*500, boundary: t.Optional[ str]
= None, charset: str
= 'utf-8') -> t.Tuple[ t.IO[ bytes], int, str]
:
(source)
¶
Encode a dict of values (either strings or file descriptors or :class:`FileStorage` objects.) into a multipart encoded string stored in a file descriptor.