feat(api): ping route and testing infra

This commit is contained in:
2024-01-17 22:01:39 -05:00
parent 782fa386d5
commit 285d11c0ab
5 changed files with 122 additions and 60 deletions

View File

@@ -0,0 +1,15 @@
import pytest
from httpx import AsyncClient
from starlette.testclient import TestClient
from src.neo_neo_todo.main import app
client = TestClient(app)
@pytest.mark.anyio
async def test_ping():
async with AsyncClient(app=app, base_url="http://test") as ac:
response = await ac.get("/control/ping")
assert response.status_code == 200
assert response.json() == {"ping": "pong"}