- Initialize FastAPI backend with uv package manager - Configure Black, Ruff, pytest, mypy in pyproject.toml - Add health check endpoint and initial test - Create AGENTS.md with coding guidelines for AI agents - Add pre-commit hook to enforce linting and tests
24 lines
585 B
Python
24 lines
585 B
Python
"""Tests for health check endpoint."""
|
|
|
|
import pytest
|
|
from fastapi.testclient import TestClient
|
|
|
|
from app.main import app
|
|
|
|
|
|
@pytest.fixture
|
|
def client() -> TestClient:
|
|
"""Create a test client for the FastAPI app."""
|
|
return TestClient(app)
|
|
|
|
|
|
def test_health_check(client: TestClient) -> None:
|
|
"""
|
|
Test that the health check endpoint returns a healthy status.
|
|
|
|
This verifies the application is running and can respond to requests.
|
|
"""
|
|
response = client.get("/health")
|
|
assert response.status_code == 200
|
|
assert response.json() == {"status": "healthy"}
|