Files
trading-journal/backend/tests/test_app.py
Tianyu Liu 466e6ce653
All checks were successful
Backend CI / unit-test (push) Successful in 34s
wip user reg
2025-09-22 17:35:10 +02:00

20 lines
461 B
Python

from collections.abc import Generator
import pytest
from fastapi.testclient import TestClient
import settings
from app import app
@pytest.fixture
def client() -> Generator[TestClient, None, None]:
with TestClient(app) as client:
yield client
def test_get_status(client: TestClient) -> None:
response = client.get(f"{settings.settings.api_base}/status")
assert response.status_code == 200
assert response.json() == {"status": "ok"}