Add coin leaderboard command
check / local-gate (push) Failing after 1m34s

This commit is contained in:
JWeBot Contributors
2026-10-15 19:00:29 +08:00
parent 148ae672f4
commit bf4f28f48e
26 changed files with 357 additions and 24 deletions
+16
View File
@@ -246,6 +246,22 @@ class Release063GameTests(unittest.TestCase):
self.assertIn("贷款金额必须为 1~500", self.command("/loan 501"))
self.assertIn("当前没有未还贷款", self.command("/还款 全部"))
def test_coin_ranking_lists_accounts_by_balance(self):
self.assertIn("金币 1000", self.command("/金币"))
self.assertIn("金币 1000", self.command("/金币", sender="Bob"))
self.assertIn("金币 1000", self.command("/金币", sender="Carol"))
self.command("/转账 Bob 250")
self.command("/贷款 100", sender="Carol")
ranking = self.command("/大富翁榜")
self.assertIn("大富翁榜:", ranking)
self.assertIn("1. bob 1250 金币", ranking)
self.assertIn("2. carol 1100 金币(未还贷款 100)", ranking)
self.assertIn("3. alice 750 金币", ranking)
self.assertNotIn("Dave", ranking)
self.assertIn("金币排行人数必须为 1~20", self.command("/金币排行 0"))
def test_open_round_and_history_survive_restart(self):
root = Path(self.temp.name)
self.command("/彩票开始")