feat: 增加公告栏并让用户自选学时判断
This commit is contained in:
@@ -386,7 +386,7 @@ class _HourSession:
|
||||
|
||||
def test_hours_watcher_stops_when_target_reached(monkeypatch) -> None:
|
||||
saved: list[tuple[str, str]] = []
|
||||
monkeypatch.setattr("euniv.autostudy._update_month_hours", lambda eid, hours: saved.append((eid, hours)))
|
||||
monkeypatch.setattr("euniv.autostudy._update_month_hours", lambda eid, hours, official="": saved.append((eid, hours)))
|
||||
|
||||
async def main() -> None:
|
||||
session = _HourSession("600")
|
||||
@@ -402,15 +402,15 @@ 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")
|
||||
monkeypatch.setattr("euniv.autostudy._update_month_hours", lambda eid, hours, official="": saved.append((eid, hours)))
|
||||
monkeypatch.setattr("admin.settings.source_for_employee", lambda _employee_id: "history")
|
||||
|
||||
class _HistorySession:
|
||||
async def month_history_minutes(self) -> int:
|
||||
return 600
|
||||
|
||||
async def month_hours_text(self) -> str:
|
||||
raise AssertionError("history 模式不应读接口本月学时")
|
||||
return "126"
|
||||
|
||||
async def main() -> None:
|
||||
user_stop = asyncio.Event()
|
||||
|
||||
Reference in New Issue
Block a user