refactor(fudai): 拆出 _handle_in_fudai_detail 入口诊断日志(1572→1556,-16 行)

log_entry_flags:进入 _handle_in_fudai_detail 时记录关键 flags 的诊断日志。

新增 2 个单元测试,1199 → 1201 用例全过。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
CodexandClaude Opus 4.7 committed 2026-05-22 03:38:23 +08:00
1 parent 1b4dc477fd
commit be95d9c279
3 files changed
+44 -17

No files matched your search

+22
View File
@@ -701,3 +701,25 @@ def test_attend_success_swallows_exception():
)
# remain_seconds=0,应该返回 False
assert result is False
# ---- log_entry_flags ---- #
def test_log_entry_flags_writes_one_line():
a = MagicMock()
a.reservation_after_action_pending = True
a.reservation_focus_until_ts = 12345.6
a._waiting_for_lottery_result = False
a.room_pos = 7
fudai_detail_blocks.log_entry_flags(a)
assert a._log_kv.call_count == 1
args, kwargs = a._log_kv.call_args
assert args[0] == "诊断"
assert kwargs["room_pos"] == 7
assert kwargs["reservation_after_action_pending"] is True
def test_log_entry_flags_swallows_exception():
a = MagicMock()
a._log_kv.side_effect = RuntimeError("boom")
fudai_detail_blocks.log_entry_flags(a)