fix(fudai): stabilize reservation fansclub prejoin

This commit is contained in:
Your Name committed 2026-06-29 01:01:48 +08:00
1 parent 51c1c2da39
commit 94e0c6432f
3 files changed
+35 -9

No files matched your search

+13 -3
View File
@@ -151,14 +151,14 @@ class TestReservationPrejoinFansclub:
assert a.last_attend_fail_reason == "fansclub_required"
assert any(c.args == (543, 2070) for c in a.click.call_args_list)
assert any(c.args == (500, 470) for c in a.click.call_args_list)
assert any(c.args == ("MOCK", 540, 2006) for c in a.operation.click.call_args_list)
assert any(c.args == ("MOCK", 550, 2050) for c in a.operation.click.call_args_list)
a.cut_pic.assert_not_called()
a.operation.analyse_pic_word.assert_not_called()
a._shot_and_diagnose.assert_not_called()
log_msgs = [str(c) for c in a._log_kv.call_args_list]
assert any("快速预处理" in m for m in log_msgs)
def test_fast_prejoin_uses_short_configured_delays(self):
def test_fast_prejoin_clamps_too_short_configured_delays(self):
a = _mk_analyser(auto_join_fansclub=True)
a.reservation_prejoin_fansclub_participate_wait_seconds = 0.2
a.reservation_prejoin_fansclub_confirm_wait_seconds = 0.3
@@ -166,7 +166,17 @@ class TestReservationPrejoinFansclub:
handle_reservation_prejoin_fansclub(a, "加入购物粉丝团并关注主播")
delay_args = [c.args[0] for c in a.operation.delay.call_args_list]
assert delay_args == [0.2, 0.3]
assert delay_args == [0.8, 1.2]
def test_fast_prejoin_keeps_safe_configured_delays(self):
a = _mk_analyser(auto_join_fansclub=True)
a.reservation_prejoin_fansclub_participate_wait_seconds = 0.9
a.reservation_prejoin_fansclub_confirm_wait_seconds = 1.3
handle_reservation_prejoin_fansclub(a, "加入购物粉丝团并关注主播")
delay_args = [c.args[0] for c in a.operation.delay.call_args_list]
assert delay_args == [0.9, 1.3]
def test_fast_prejoin_default_delays_wait_for_join_page_and_result(self):
a = _mk_analyser(auto_join_fansclub=True)