Improve fudai live flow diagnostics
This commit is contained in:
1 parent
daa4d1709d
commit
9ffbe47bdb
9 files changed
+163
-14
No files matched your search
@@ -171,6 +171,57 @@ def test_simple_suppresses_ocr_summary_and_validation_noise(capsys):
|
||||
assert capsys.readouterr().out == ""
|
||||
|
||||
|
||||
def test_simple_actions_log_skips_fudai_probe_noise(monkeypatch, tmp_path, capsys):
|
||||
import douyin.core.path_config as path_config
|
||||
|
||||
monkeypatch.setattr(path_config, "get_logs_dir", lambda: str(tmp_path))
|
||||
monkeypatch.setattr(
|
||||
path_config, "get_actions_log_path", lambda: str(tmp_path / "actions.log")
|
||||
)
|
||||
|
||||
analyser = _analyser()
|
||||
_enhanced_log_kv_simple(
|
||||
analyser,
|
||||
"[福袋查找] 检测完成",
|
||||
"[福袋查找] 检测完成",
|
||||
"INFO",
|
||||
["[2026-06-18 04:35:40.000]", "[INFO]", "[福袋查找]", "[福袋查找] 检测完成"],
|
||||
"2026-06-18 04:35:40.000",
|
||||
{"elapsed_ms": 10.0},
|
||||
False,
|
||||
"",
|
||||
)
|
||||
|
||||
capsys.readouterr()
|
||||
assert not (tmp_path / "actions.log").exists()
|
||||
|
||||
|
||||
def test_simple_actions_log_keeps_real_attend_result(monkeypatch, tmp_path, capsys):
|
||||
import douyin.core.path_config as path_config
|
||||
|
||||
monkeypatch.setattr(path_config, "get_logs_dir", lambda: str(tmp_path))
|
||||
monkeypatch.setattr(
|
||||
path_config, "get_actions_log_path", lambda: str(tmp_path / "actions.log")
|
||||
)
|
||||
|
||||
analyser = _analyser()
|
||||
_enhanced_log_kv_simple(
|
||||
analyser,
|
||||
"参与",
|
||||
"参与成功,设置等待开奖标志",
|
||||
"INFO",
|
||||
["[2026-06-18 04:35:40.000]", "[INFO]", "[参与]", "参与成功,设置等待开奖标志"],
|
||||
"2026-06-18 04:35:40.000",
|
||||
{},
|
||||
False,
|
||||
"",
|
||||
)
|
||||
|
||||
capsys.readouterr()
|
||||
actions_text = (tmp_path / "actions.log").read_text(encoding="utf-8-sig")
|
||||
assert "参与成功,设置等待开奖标志" in actions_text
|
||||
|
||||
|
||||
def test_enhanced_log_preserves_simple_and_detail_files(monkeypatch, tmp_path):
|
||||
import douyin.core.path_config as path_config
|
||||
|
||||
|
||||
Reference in new issue
Block a user