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: ~typing.Optional[~typing.Union[dict, ~werkzeug.datastructures.Headers]] = None, data: ~typing.Optional[AnyStr] = None, form: ~typing.Optional[dict] = None, files: ~typing.Optional[~typing.Dict[str, ~quart.datastructures.FileStorage]] = None, query_string: ~typing.Optional[dict] = None, json: ~typing.Any = <object object>, scheme: str = 'http', follow_redirects: bool = False, root_path: str = '', http_version: str = '1.1', scope_base: ~typing.Optional[dict] = None, auth: ~typing.Optional[~typing.Union[~werkzeug.datastructures.Authorization, ~typing.Tuple[str, str]]] = None, subdomain: ~typing.Optional[str] = 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: Optional[Union[dict, Headers]] = None, query_string: Optional[dict] = None, scheme: str = 'http', root_path: str = '', http_version: str = '1.1', scope_base: Optional[dict] = None, auth: Optional[Union[Authorization, Tuple[str, str]]] = None, subdomain: Optional[str] = None) TestHTTPConnectionProtocol#
session_transaction(path: str = '/', *, method: str = 'GET', headers: ~typing.Optional[~typing.Union[dict, ~werkzeug.datastructures.Headers]] = None, query_string: ~typing.Optional[dict] = None, scheme: str = 'http', data: ~typing.Optional[AnyStr] = None, form: ~typing.Optional[dict] = None, json: ~typing.Any = <object object>, root_path: str = '', http_version: str = '1.1', auth: ~typing.Optional[~typing.Union[~werkzeug.datastructures.Authorization, ~typing.Tuple[str, str]]] = 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: Optional[Union[dict, Headers]] = None, query_string: Optional[dict] = None, scheme: str = 'ws', subprotocols: Optional[List[str]] = None, root_path: str = '', http_version: str = '1.1', scope_base: Optional[dict] = None, auth: Optional[Union[Authorization, Tuple[str, str]]] = None, subdomain: Optional[str] = None) TestWebsocketConnectionProtocol#
websocket_connection_class#

alias of TestWebsocketConnection