feat(02-02): add driver upload endpoint with INF parsing and dedup

- POST /drivers/upload: validates ZIP, parses INF, persists via DriverStore + Peewee
- SHA256 dedup: get_or_create prevents duplicate Driver records
- GET /drivers route added to pages.py with driver_data context
- drivers.router registered in main.py
- drivers.html template with HTMX upload form
- partials/driver_list.html HTMX target with select dropdown and unused-file notice
- Fixed conftest client fixture to use context manager (triggers lifespan/init_db)
- [Rule 3] conftest: TestClient context manager required for lifespan trigger
- [Rule 1] drivers.py: dynamic DRIVERS_DIR read so monkeypatch works in tests
This commit is contained in:
2026-04-10 12:02:00 +02:00
parent 8ecfbf25a7
commit c648fc5793
6 changed files with 212 additions and 2 deletions
+2 -1
View File
@@ -8,7 +8,8 @@ from fastapi.testclient import TestClient
def client(tmp_data_dir):
from imptune.main import app
return TestClient(app)
with TestClient(app) as c:
yield c
@pytest.fixture