Release beta 1.0.3 Mora wallet updates
This commit is contained in:
@@ -39,7 +39,7 @@ class Release061Tests(unittest.TestCase):
|
||||
return json.loads(row[0])
|
||||
|
||||
def test_aliases_are_corresponding_and_case_insensitive(self):
|
||||
pairs = [("上下文", "Context"), ("金币", "wallet"), ("抽奖", "draw"),
|
||||
pairs = [("上下文", "Context"), ("摩拉", "wallet"), ("抽奖", "draw"),
|
||||
("买彩票", "lottery"), ("21点", "blackjack"),
|
||||
("人物列表", "people"), ("人物", "person"), ("游戏帮助", "games")]
|
||||
for chinese, english in pairs:
|
||||
@@ -82,18 +82,18 @@ class Release061Tests(unittest.TestCase):
|
||||
self.assertEqual(ledger.search_repeat_history("group-a", "好"), [])
|
||||
|
||||
def test_initial_funds_aliases_groups_and_replay(self):
|
||||
self.assertIn("金币 1000", self.command("/wallet", event_id="wallet-1"))
|
||||
self.assertIn("摩拉 1000", self.command("/wallet", event_id="wallet-1"))
|
||||
with mock.patch.object(self.local.players.rng, "randrange", return_value=99):
|
||||
first = self.command("/draw 10", event_id="draw-1")
|
||||
replay = self.command("/draw 10", sender="a1", event_id="draw-1")
|
||||
self.assertEqual(first, replay)
|
||||
self.assertEqual(self.state("a1")["balance"], 990)
|
||||
self.assertIn("金币 1000", self.command("/wallet", sender="Bob"))
|
||||
self.assertIn("金币 1000", self.command("/wallet", group="group-b"))
|
||||
self.assertIn("摩拉 1000", self.command("/wallet", sender="Bob"))
|
||||
self.assertIn("摩拉 1000", self.command("/wallet", group="group-b"))
|
||||
self.engine.ledger.connection.close()
|
||||
self.engine = MODULE.EdgeApplication(config(self.root))
|
||||
self.local = self.engine.local
|
||||
self.assertIn("金币 990", self.command("/wallet", event_id="restart"))
|
||||
self.assertIn("摩拉 990", self.command("/wallet", event_id="restart"))
|
||||
|
||||
def test_concurrent_replay_debits_once_and_rolls_back_failure(self):
|
||||
replies = []
|
||||
@@ -123,7 +123,7 @@ class Release061Tests(unittest.TestCase):
|
||||
with mock.patch.object(self.local.players.rng, "randrange", return_value=99):
|
||||
for _ in range(10):
|
||||
self.command("/draw 100")
|
||||
self.assertIn("金币不足", self.command("/draw 2"))
|
||||
self.assertIn("摩拉不足", self.command("/draw 2"))
|
||||
self.assertEqual(self.state()["balance"], 0)
|
||||
|
||||
def test_blackjack_is_private_persistent_and_settles_exactly_once(self):
|
||||
|
||||
Reference in New Issue
Block a user