add tests

This commit is contained in:
2026-10-26 23:02:39 +03:00
parent 3082b84f61
commit 8ad0bb6947
22 changed files with 1042 additions and 121 deletions
+3 -3
View File
@@ -1,7 +1,7 @@
from httpx import AsyncClient
from app.main import create_app
from tests.conftest import make_client
from tests.conftest import close_app, make_client
from tests.helpers import assert_request_id
@@ -35,7 +35,7 @@ async def test_readiness_is_503_when_database_is_down(make_settings):
assert ready.status_code == 503
assert ready.json()["error"]["code"] == "unavailable"
assert_request_id(ready)
await app.state.engine.dispose()
await close_app(app)
async def test_business_request_is_503_when_database_is_down(make_settings):
@@ -54,7 +54,7 @@ async def test_business_request_is_503_when_database_is_down(make_settings):
"password": "Correct-horse-battery-1",
},
)
await app.state.engine.dispose()
await close_app(app)
assert response.status_code == 503
assert response.json()["error"]["code"] == "unavailable"