shortdeck1.0
This commit is contained in:
Binary file not shown.
26
shortdeck_server/tests/test_game.py
Normal file
26
shortdeck_server/tests/test_game.py
Normal file
@@ -0,0 +1,26 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from shortdeck_server.arena_adapter import ArenaGame
|
||||
|
||||
|
||||
def test_join_and_actions():
|
||||
g = ArenaGame(starting_stack=100, max_players=3)
|
||||
pid0 = g.join_game("aa")
|
||||
pid1 = g.join_game("bb")
|
||||
assert pid0 == 0
|
||||
assert pid1 == 1
|
||||
|
||||
state = g.info()
|
||||
assert state["stacks"] == [100, 100]
|
||||
try:
|
||||
g.apply_action(1, "fold")
|
||||
except ValueError as e:
|
||||
assert "not your turn" in str(e)
|
||||
|
||||
g.apply_action(0, "check")
|
||||
assert g.current_turn == 1
|
||||
|
||||
g.apply_action(1, "bet", 10)
|
||||
assert g.pot == 10
|
||||
assert g.stacks[1] == 90
|
||||
assert g.history[-1]["action"] == "bet"
|
||||
Reference in New Issue
Block a user