# quart.testing.utils module

quart.testing.utils.make_test_headers_path_and_query_string(app, path, headers=None, query_string=None, auth=None, subdomain=None)

  Make the headers and path with defaults for testing.

  Parameters:

    - app (Quart) – The application to test against.

    - path (str) – The path to request. If the query_string argument is not defined this argument will be partitioned on a ‘?’ with the following part being considered the query_string.

    - headers (dict | Headers | None) – Initial headers to send.

    - query_string (dict | None) – To send as a dictionary, alternatively the query_string can be determined from the path.

    - auth (Authorization | tuple[str, str] | None)

    - subdomain (str | None)

  Return type:

    tuple[Headers, str, bytes]

quart.testing.utils.make_test_body_with_headers(*, data=None, form=None, files=None, json=sentinel, app=None)

  Make the body bytes with associated headers.

  Parameters:

    - data (AnyStr | None) – Raw data to send in the request body.

    - form (dict | None) – Key value paired data to send form encoded in the request body.

    - files (dict[str, FileStorage] | None) – Key FileStorage paired data to send as file encoded in the request body.

    - json (Any) – Data to send json encoded in the request body.

    - app (Quart | None)

  Return type:

    tuple[bytes, Headers]

quart.testing.utils.make_test_scope(type_: Literal['http'], path: str, method: str, headers: Headers, query_string: bytes, scheme: str, root_path: str, http_version: str, scope_base: dict | None, *, _preserve_context: bool = False) → HTTPScope
quart.testing.utils.make_test_scope(type_: Literal['websocket'], path: str, method: str, headers: Headers, query_string: bytes, scheme: str, root_path: str, http_version: str, scope_base: dict | None, *, _preserve_context: bool = False) → WebsocketScope

async quart.testing.utils.no_op_push(path, headers)

  A push promise sender that does nothing.

  This is best used when creating Request instances for testing outside of the QuartClient. The Request instance must know what to do with push promises, and this gives it the option of doing nothing.

  Parameters:

    - path (str)

    - headers (Headers)

  Return type:

    None