fix: 补齐审查清单里还没落地的交互和代理复测

This commit is contained in:
2026-11-16 16:17:31 +08:00
parent 58b3dedb2a
commit 50a8ae2e27
19 changed files with 444 additions and 192 deletions
+2 -1
View File
@@ -209,6 +209,7 @@ def test_hours_watcher_stops_when_target_reached(monkeypatch) -> None:
def test_hours_watcher_history_source_uses_month_history(monkeypatch) -> None:
saved: list[tuple[str, str]] = []
monkeypatch.setattr("euniv.autostudy._update_month_hours", lambda eid, hours: saved.append((eid, hours)))
monkeypatch.setattr("admin.settings.hours_source_of", lambda: "history")
class _HistorySession:
async def month_history_minutes(self) -> int:
@@ -219,7 +220,7 @@ def test_hours_watcher_history_source_uses_month_history(monkeypatch) -> None:
async def main() -> None:
user_stop = asyncio.Event()
watcher = HoursWatcher(_HistorySession(), "u1", 600, user_stop, source="history")
watcher = HoursWatcher(_HistorySession(), "u1", 600, user_stop)
assert await watcher.refresh() is True
assert watcher.reached
assert saved == [("u1", "600")]