Files
trading-journal/backend/tests/test_app.py

20 lines
461 B
Python
Raw Normal View History

2025-09-22 14:33:32 +02:00
from collections.abc import Generator
import pytest
from fastapi.testclient import TestClient
2025-09-22 17:35:10 +02:00
import settings
from app import app
2025-09-22 14:33:32 +02:00
@pytest.fixture
def client() -> Generator[TestClient, None, None]:
with TestClient(app) as client:
yield client
def test_get_status(client: TestClient) -> None:
2025-09-22 17:35:10 +02:00
response = client.get(f"{settings.settings.api_base}/status")
2025-09-22 14:33:32 +02:00
assert response.status_code == 200
assert response.json() == {"status": "ok"}