Files
2026-03-17 18:32:44 +03:00

12 lines
442 B
Python

from httpx import AsyncClient, ASGITransport
import pytest
from app.main import app
@pytest.mark.asyncio
async def test_ping():
# Используем ASGITransport для современных версий httpx
async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as ac:
response = await ac.get("/api/ping")
assert response.status_code == 200
assert response.json() == {"status": "ok"}