From d1871d3919e71b6b60c8e5cf400fdf63226ad9ee Mon Sep 17 00:00:00 2001 From: "Mr.Xia" <1424473282@qq.com> Date: Tue, 7 Apr 2026 20:22:48 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E4=B8=BA=E5=86=85=E5=AD=98=E7=A7=AF?= =?UTF-8?q?=E5=88=86=E6=9C=8D=E5=8A=A1=E6=B7=BB=E5=8A=A0=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E4=BD=99=E9=A2=9D=E7=9A=84=E6=A8=A1=E6=8B=9F=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加 get_balance 方法到 _InMemoryPointsService 模拟类中,以便在测试中能够模拟查询用户余额的操作。 --- danding_bot/plugins/group_horse_racing/test_commands.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/danding_bot/plugins/group_horse_racing/test_commands.py b/danding_bot/plugins/group_horse_racing/test_commands.py index 32f20d4..579d1cd 100644 --- a/danding_bot/plugins/group_horse_racing/test_commands.py +++ b/danding_bot/plugins/group_horse_racing/test_commands.py @@ -190,6 +190,10 @@ class _InMemoryPointsService: self.calls.append(("refund_bet_points", {"user_id": user_id, "amount": amount, "reason": reason})) return True, 0 + async def get_balance(self, user_id: str) -> int: + self.calls.append(("get_balance", {"user_id": user_id})) + return 0 + class _NoopMessageService: def clear_pending_recalls(self, scope: str):