feat: basic function

This commit is contained in:
2026-05-11 00:44:15 +08:00
committed by qianrui.mmmy
commit e46b2b84c5
17 changed files with 1946 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
import unittest
from texas_holdem.service import GameManager
class ServiceTests(unittest.TestCase):
def test_create_and_run_game(self) -> None:
manager = GameManager()
game = manager.create_game(
{
"game_id": "demo",
"seed": 11,
"starting_stack": 200,
"small_blind": 5,
"big_blind": 10,
"players": [
{"id": "a", "type": "calling"},
{"id": "b", "type": "calling"},
],
}
)
hands = manager.run_hands(game.game_id, count=1)
self.assertEqual(len(hands), 1)
self.assertEqual(manager.get_game("demo").to_dict()["hand_number"], 1)
if __name__ == "__main__":
unittest.main()