quart.testing.client module#

class quart.testing.client.QuartClient(app: Quart, use_cookies: bool = True)#

Bases: object

async delete(*args: Any, **kwargs: Any) Response#

Make a DELETE request.

See open() for argument details.

Delete a cookie (set to expire immediately).

async get(*args: Any, **kwargs: Any) Response#

Make a GET request.

See open() for argument details.

async head(*args: Any, **kwargs: Any) Response#

Make a HEAD request.

See open() for argument details.

http_connection_class#

alias of TestHTTPConnection

async open(path: str, *, method: str = 'GET', headers: dict | ~werkzeug.datastructures.headers.Headers | None = None, data: AnyStr | None = None, form: dict | None = None, files: dict[str, ~quart.datastructures.FileStorage] | None = None, query_string: dict | None = None, json: ~typing.Any = <object object>, scheme: str = 'http', follow_redirects: bool = False, root_path: str = '', http_version: str = '1.1', scope_base: dict | None = None, auth: ~werkzeug.datastructures.auth.Authorization | tuple[str, str] | None = None, subdomain: str | None = None) Response#
async options(*args: Any, **kwargs: Any) Response#

Make a OPTIONS request.

See open() for argument details.

async patch(*args: Any, **kwargs: Any) Response#

Make a PATCH request.

See open() for argument details.

async post(*args: Any, **kwargs: Any) Response#

Make a POST request.

See open() for argument details.

async put(*args: Any, **kwargs: Any) Response#

Make a PUT request.

See open() for argument details.

request(path: str, *, method: str = 'GET', headers: dict | Headers | None = None, query_string: dict | None = None, scheme: str = 'http', root_path: str = '', http_version: str = '1.1', scope_base: dict | None = None, auth: Authorization | tuple[str, str] | None = None, subdomain: str | None = None) TestHTTPConnectionProtocol#
session_transaction(path: str = '/', *, method: str = 'GET', headers: dict | ~werkzeug.datastructures.headers.Headers | None = None, query_string: dict | None = None, scheme: str = 'http', data: AnyStr | None = None, form: dict | None = None, json: ~typing.Any = <object object>, root_path: str = '', http_version: str = '1.1', auth: ~werkzeug.datastructures.auth.Authorization | tuple[str, str] | None = None) AsyncGenerator[SessionMixin, None]#

Set a cookie in the cookie jar.

The arguments are the standard cookie morsels and this is a wrapper around the stdlib SimpleCookie code.

async trace(*args: Any, **kwargs: Any) Response#

Make a TRACE request.

See open() for argument details.

websocket(path: str, *, headers: dict | Headers | None = None, query_string: dict | None = None, scheme: str = 'ws', subprotocols: list[str] | None = None, root_path: str = '', http_version: str = '1.1', scope_base: dict | None = None, auth: Authorization | tuple[str, str] | None = None, subdomain: str | None = None) TestWebsocketConnectionProtocol#
websocket_connection_class#

alias of TestWebsocketConnection