add tests
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user