修复福袋详情OCR v2与调试日志
This commit is contained in:
1 parent
2c6f024a24
commit
1d37d57c90
119 files changed
+5582
-767
No files matched your search
@@ -8,6 +8,10 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import time
|
||||
from types import SimpleNamespace
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
@@ -157,6 +161,29 @@ class TestDouyinYanghaoShimConsistency:
|
||||
assert f1 is f2
|
||||
|
||||
|
||||
class TestTimedYanghaoTrigger:
|
||||
def test_maybe_run_yanghao_uses_recommend_flow(self):
|
||||
from douyin.core.douyin_fudai import fudai_analyse
|
||||
|
||||
s = SimpleNamespace()
|
||||
s.yanghao_recommend_interval_seconds = 60
|
||||
s.yanghao_recommend_duration_seconds = 30
|
||||
s._waiting_for_lottery_result = False
|
||||
s._current_attending_reservation_fudai = False
|
||||
s.reservations = []
|
||||
s.reservation_focus_until_ts = 0.0
|
||||
s._last_yanghao_ts = 0.0
|
||||
s._log_kv = MagicMock(return_value=None)
|
||||
s._yanghao_recommend_flow = MagicMock(return_value=None)
|
||||
s._yanghao_wait = MagicMock(return_value=None)
|
||||
|
||||
fudai_analyse._maybe_run_yanghao_during_run(s)
|
||||
|
||||
s._yanghao_recommend_flow.assert_called_once_with(30)
|
||||
s._yanghao_wait.assert_not_called()
|
||||
assert s._last_yanghao_ts > 0.0
|
||||
|
||||
|
||||
class TestOtherModules:
|
||||
"""other 子模块存在性测试。"""
|
||||
|
||||
|
||||
Reference in new issue
Block a user