feat: 心跳间隔改由每个用户自己设置

This commit is contained in:
2026-11-17 12:42:23 +08:00
parent b83fd637ab
commit cc9b2d56a4
10 changed files with 320 additions and 46 deletions
+14
View File
@@ -685,6 +685,20 @@ def test_want_and_drop_work_push_home(monkeypatch) -> None:
assert seen == ["u-push", "u-push"]
def test_intervals_of_uses_that_account() -> None:
from euniv.heartbeat import intervals_of
class Account:
heartbeat_mode = "manual"
heartbeat_video_seconds = 1
heartbeat_document_seconds = 2
heartbeat_scorm_seconds = 3
intervals, auto = intervals_of(Account())
assert auto is False
assert intervals == {"video": 1, "document": 2, "scorm": 3}
def test_interval_plan_manual_one_second_uses_admin_wait() -> None:
wait, step, page = _interval_plan(
"video", {"video": 1, "document": 1, "scorm": 1}, False, {"submitProTimes": 30, "pageSize": 1},