Skip to content

Test hestia

test_health(client, fastapi_app) async

Checks the health endpoint.

Parameters:

Name Type Description Default
client AsyncClient

client for the app.

required
fastapi_app FastAPI

current FastAPI application.

required
Source code in hestia/tests/test_hestia.py
 7
 8
 9
10
11
12
13
14
15
16
17
@pytest.mark.anyio
async def test_health(client: AsyncClient, fastapi_app: FastAPI) -> None:
    """
    Checks the health endpoint.

    :param client: client for the app.
    :param fastapi_app: current FastAPI application.
    """
    url = fastapi_app.url_path_for("health_check")
    response = await client.get(url)
    assert response.status_code == status.HTTP_200_OK