fix: align all 212 tests with current API and add CI workflows
Some checks failed
Test / test (push) Failing after 1m4s

Update integration tests to match actual endpoint responses: remove
data wrappers, use snake_case fields, correct HTTP methods (PUT→POST
for directory create), status codes (200→204 for mutations), and
request formats (params→json for 2FA). Fix root-level and unit tests
for DatabaseManager migration, model CRUD patterns, and JWT setup.
Add GitHub Actions and Gitea CI configs with ubuntu-latest + Python 3.13.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-13 14:21:40 +08:00
parent 800c85bf8d
commit 69f852a4ce
20 changed files with 480 additions and 586 deletions

View File

@@ -417,12 +417,12 @@ async def async_client(initialized_db: AsyncSession) -> AsyncGenerator[AsyncClie
"""异步HTTP测试客户端"""
# 覆盖依赖项,使用测试数据库
from middleware.dependencies import get_session
from sqlmodels.database_connection import DatabaseManager
async def override_get_session():
yield initialized_db
app.dependency_overrides[get_session] = override_get_session
app.dependency_overrides[DatabaseManager.get_session] = override_get_session
transport = ASGITransport(app=app)
async with AsyncClient(transport=transport, base_url="http://test") as client: