Files
mmintelandClaude Opus 5.5 0fcf356c42 Modi: Turnierlage an den Kern, K-Poker setzt aus, Modus in der Ansicht
The tournament lobby was already parsed but never reached the core. Each
tournament table is now linked to its lobby (tourneyLobbyName or
tournamentId) and the request carries `tournament`; a missing price or
rank list makes the turn unclear instead of guessing. K-Poker tables
(roomProperties.isKPoker) abstain until the key table is measured
(mock/vorlage/kpoker-tasten.md). The clone writes the rank list with each
lobby update and the tournament ids where the real log has them; the
view shows level, field and bubble, or menu and clock.

klonmaus appends mock/ to sys.path so mock/turnier.py no longer shadows
lesen/turnier.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 09:50:12 +01:00

51 lines
2.2 KiB
Python

#!/usr/bin/env python3
"""Spezifikation: ein K-Poker-Tisch wird nicht als NLHE gespielt.
Belegt: `roomProperties.isKPoker` steht in jeder `game.game_alldata` (im Bestand immer false).
Nicht belegt: welche Taste welche Aktion und welchen Betrag auslöst - die Messvorlage
mock/vorlage/kpoker-tasten.md ist noch leer. Bis sie gefüllt ist:
* isKPoker true -> variant K_POKER, aussetzen (legalActions leer),
`_unklar` "K-Poker: Tastentabelle nicht gemessen"
* isKPoker false -> unverändert (NLHE aus miniGameTypeId 1)
* das Menü in `kpokerActions` (Annahme-Form des Klons) geht weiter vor: es nennt Aktionen und Größen
python3 tests/kpoker_tisch_spec.py -v
"""
import json
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import uebersetzung_spec as u # noqa: E402 (Zeilenbau: zeile, grund, zug)
def alldata(kpoker):
return u.zeile("game.game_alldata", {
"gameInitResponseData": {"bigBlind": 0.1, "gameHandId": None},
"seatInfoRsponseData": {"isGameStarted": False, "seatResponseDataList": []},
"roomProperties": {"gameType": "Ring", "miniGameTypeId": 1, "isKPoker": kpoker}})
class KPokerTisch(unittest.TestCase):
def test_kpoker_tisch_setzt_aus(self):
(a, _), = u.anfragen(alldata(True) + u.grund(u.FLOP) + u.zug())
self.assertEqual(a["variant"], "K_POKER")
self.assertEqual(a["legalActions"], [])
self.assertEqual(a["_unklar"], "K-Poker: Tastentabelle nicht gemessen")
def test_gewoehnlicher_tisch_bleibt(self):
(a, _), = u.anfragen(alldata(False) + u.grund(u.FLOP) + u.zug())
self.assertEqual((a["variant"], a["legalActions"]), ("NLHE", ["FOLD", "CALL", "RAISE"]))
self.assertNotIn("_unklar", a)
def test_menue_im_log_geht_vor(self):
menue = [{"action": "FOLD"}, {"action": "CALL", "amount": 0.4}, {"action": "RAISE", "amount": 1.2}]
(a, _), = u.anfragen(alldata(True) + u.grund(u.FLOP) + u.zug(kpokerActions=menue))
self.assertEqual((a["variant"], a["legalActions"], a["allowedSizes"]), ("K_POKER", ["FOLD", "CALL", "RAISE"], [1.2]))
if __name__ == "__main__":
unittest.main()