quart.testing.client module

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

Bases: object

async delete(*args: Any, **kwargs: Any) quart.wrappers.response.Response

Make a DELETE request.

See open() for argument details.

Delete a cookie (set to expire immediately).

async get(*args: Any, **kwargs: Any) quart.wrappers.response.Response

Make a GET request.

See open() for argument details.

async head(*args: Any, **kwargs: Any) quart.wrappers.response.Response

Make a HEAD request.

See open() for argument details.

http_connection_class

alias of quart.testing.connections.TestHTTPConnection

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

Make a OPTIONS request.

See open() for argument details.

async patch(*args: Any, **kwargs: Any) quart.wrappers.response.Response

Make a PATCH request.

See open() for argument details.

async post(*args: Any, **kwargs: Any) quart.wrappers.response.Response

Make a POST request.

See open() for argument details.

async put(*args: Any, **kwargs: Any) quart.wrappers.response.Response

Make a PUT request.

See open() for argument details.

request(path: str, *, method: str = 'GET', headers: Optional[Union[dict, werkzeug.datastructures.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[werkzeug.datastructures.Authorization, Tuple[str, str]]] = None) quart.typing.TestHTTPConnectionProtocol
session_transaction(path: str = '/', *, method: str = 'GET', headers: Optional[Union[dict, werkzeug.datastructures.Headers]] = None, query_string: Optional[dict] = None, scheme: str = 'http', data: Optional[AnyStr] = None, form: Optional[dict] = None, json: Any = <object object>, root_path: str = '', http_version: str = '1.1', auth: Optional[Union[werkzeug.datastructures.Authorization, Tuple[str, str]]] = None) AsyncGenerator[quart.sessions.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) quart.wrappers.response.Response

Make a TRACE request.

See open() for argument details.

websocket(path: str, *, headers: Optional[Union[dict, werkzeug.datastructures.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[werkzeug.datastructures.Authorization, Tuple[str, str]]] = None) quart.typing.TestWebsocketConnectionProtocol
websocket_connection_class

alias of quart.testing.connections.TestWebsocketConnection