fix(fudai): root-fix countdown minute misread with full-line mm:ss priority
This commit is contained in:
1 parent
33d05fac54
commit
c2010084cf
4 files changed
+128
-5
No files matched your search
@@ -4,6 +4,7 @@ from unittest.mock import MagicMock
|
||||
|
||||
from douyin.fudai.douyin_fudai_contain_impl import (
|
||||
_build_countdown_candidate_boxes,
|
||||
_parse_mmss_from_full_text,
|
||||
_select_countdown_from_candidates,
|
||||
)
|
||||
from douyin.fudai.douyin_fudai_core_pkg.countdown_parse import (
|
||||
@@ -161,3 +162,15 @@ def test_build_countdown_candidate_boxes_excludes_far_value_band():
|
||||
# renwu=2 主候选在 1110~1230,1460~1580 的候选应被过滤,避免扫到“参考价/¥0”。
|
||||
boxes = _build_countdown_candidate_boxes(2)
|
||||
assert (390, 1460, 690, 1580) not in boxes
|
||||
|
||||
|
||||
def test_parse_mmss_from_full_text_extracts_valid_pair():
|
||||
mm, ss = _parse_mmss_from_full_text("13:53后开奖")
|
||||
assert mm == "13"
|
||||
assert ss == "53"
|
||||
|
||||
|
||||
def test_parse_mmss_from_full_text_ignores_non_countdown_text():
|
||||
mm, ss = _parse_mmss_from_full_text("直播间,否则会失去抽奖机会")
|
||||
assert mm == ""
|
||||
assert ss == ""
|
||||
Reference in new issue
Block a user