mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 14:40:00 +08:00
Ship folder-based workspaces and data migration, daily practice, redesigned provider and model settings, and streaming conversation improvements. Synchronize README translations and document the archive/permanent-delete upgrade behavior in assets/releases/ver1-6-9.md. Reduce initial JavaScript by deduplicating English resources and loading animation features after hydration. Keep the existing route size budgets. Update regression fixtures and browser audits for scoped URLs and the new settings and learning interfaces.
33 lines
1.0 KiB
Python
33 lines
1.0 KiB
Python
from __future__ import annotations
|
|
|
|
import pytest
|
|
|
|
from deeptutor.app.container import ApplicationContainer
|
|
|
|
|
|
@pytest.mark.asyncio
|
|
async def test_startup_data_migrations_run_legacy_then_workspace_upgrade(monkeypatch) -> None:
|
|
container = object.__new__(ApplicationContainer)
|
|
calls: list[str] = []
|
|
|
|
async def migrate_legacy() -> list[dict[str, object]]:
|
|
calls.append("legacy")
|
|
return [{"imported": 2}]
|
|
|
|
async def migrate_workspace() -> list[dict[str, object]]:
|
|
calls.append("workspace")
|
|
return [{"migrated": 3}]
|
|
|
|
container.migrate_all_legacy_chats = migrate_legacy # type: ignore[method-assign]
|
|
container.migrate_all_workspace_preferences = migrate_workspace # type: ignore[method-assign]
|
|
monkeypatch.setattr(container, "_local_users", lambda: [])
|
|
|
|
reports = await container.run_startup_data_migrations()
|
|
|
|
assert calls == ["legacy", "workspace"]
|
|
assert reports == {
|
|
"legacy_chat": [{"imported": 2}],
|
|
"workspace_preferences": [{"migrated": 3}],
|
|
"workspace_data": [],
|
|
}
|