feat(US7+US8): finetune management and health check test

- app/models/finetune_models.py: FinetuneStartRequest, FinetuneStartResponse, FinetuneStatusResponse
- app/services/finetune_service.py: submit_finetune + get_finetune_status via run_in_executor; status map running→RUNNING, succeeded→SUCCESS, failed→FAILED, unknown→RUNNING; LLMCallError on SDK failure
- app/routers/finetune.py: POST /finetune/start + GET /finetune/status/{job_id} with get_llm_client dependency
- tests/test_finetune_service.py: 12 unit tests (TDD, written before implementation)
- tests/test_finetune_router.py: 6 integration tests
- tests/test_health.py: GET /health → 200 {"status":"ok"}

Full suite: 72/72 passing (was 53)
This commit is contained in:
wh
2026-04-10 16:27:51 +08:00
parent 00f092e728
commit 603382d1fa
6 changed files with 379 additions and 1 deletions

8
tests/test_health.py Normal file
View File

@@ -0,0 +1,8 @@
"""T047: Health check endpoint test — GET /health → 200 {"status": "ok"}"""
from fastapi.testclient import TestClient
def test_health_returns_ok(client: TestClient):
response = client.get("/health")
assert response.status_code == 200
assert response.json() == {"status": "ok"}