-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from __future__ import annotations | ||
|
||
import pytest | ||
import shortuuid | ||
|
||
from dl_api_lib_tests.db.base import DefaultApiTestBase | ||
from dl_configs.enums import RequiredService | ||
|
||
|
||
class TestPing(DefaultApiTestBase): | ||
@pytest.mark.asyncio | ||
async def test_ping(self, data_api_lowlevel_aiohttp_client): | ||
client = data_api_lowlevel_aiohttp_client | ||
req_id = shortuuid.uuid() | ||
|
||
resp = await client.get("/ping", headers={"x-request-id": req_id}) | ||
assert resp.status == 200 | ||
js = await resp.json() | ||
assert js["request_id"].startswith(req_id + "--") | ||
|
||
@pytest.mark.asyncio | ||
async def test_ping_ready(self, data_api_lowlevel_aiohttp_client): | ||
client = data_api_lowlevel_aiohttp_client | ||
req_id = shortuuid.uuid() | ||
|
||
resp = await client.get("/ping_ready", headers={"x-request-id": req_id}) | ||
assert resp.status == 200 | ||
js = await resp.json() | ||
assert js["request_id"].startswith(req_id + "--") | ||
details = js["details"] | ||
assert details[RequiredService.POSTGRES.name] is True | ||
assert details[RequiredService.RQE_INT_SYNC.name] == 200 | ||
assert details[RequiredService.RQE_EXT_SYNC.name] == 200 |