formate: Bomb Pot bleibt Bomb Pot trotz fremdem gameType; RIT/EV kippen cash nicht (+Spec)
This commit is contained in:
+6
-1
@@ -37,8 +37,13 @@ def aus_raum(rp, turnier=False):
|
||||
art = rp.get("gameType")
|
||||
if art == GAMETYPE_AOF:
|
||||
return AOF
|
||||
# Ein Bomb Pot bleibt Bomb Pot, auch wenn der gameType daneben steht oder fehlt - der Schalter
|
||||
# ist eindeutig, `gameType` ist es nicht. RIT/EV-Chop dagegen sind KEIN eigenes Format: sie
|
||||
# aendern cash nicht (Doppelbrett ebenso wenig - das ist eine Sache der Hand).
|
||||
if rp.get("isBombpot") is True or rp.get("isFixedHandBombpot") is True:
|
||||
return BOMBPOT
|
||||
if art == GAMETYPE_RING:
|
||||
return BOMBPOT if rp.get("isBombpot") is True else CASH
|
||||
return CASH
|
||||
return None
|
||||
|
||||
|
||||
|
||||
@@ -76,6 +76,31 @@ class FormatJeTisch(unittest.TestCase):
|
||||
self.assertIn("2", grund)
|
||||
|
||||
|
||||
class SonderfaelleBleibenToleriert(unittest.TestCase):
|
||||
"""Die Sonderfaelle der Tische (RIT, EV-Chop, Bomb Pot, Doppelbrett) duerfen das Format
|
||||
nicht kippen: RIT/EV sind keine eigenen Formate, ein Bomb Pot bleibt Bomb Pot - auch wenn der
|
||||
gameType daneben steht. Daten woertlich aus der lebenden Liste (lesen/raumliste)."""
|
||||
|
||||
RIT_EV = {"gameType": "Ring", "miniGameTypeId": 1, "isBombpot": False, "isKPoker": False,
|
||||
"iRitOptions": [0, 1, 2], "isEVChopAllowed": True}
|
||||
|
||||
def test_rit_und_ev_sind_weiter_cash(self):
|
||||
self.assertEqual(tisch(self.RIT_EV).format(), "cash")
|
||||
|
||||
def test_bombpot_gewinnt_gegen_unbekannten_gametype(self):
|
||||
# isBombpot true, gameType daneben: bleibt Bomb Pot, nicht unbekannt
|
||||
self.assertEqual(tisch(dict(RING, gameType="BombPot", isBombpot=True)).format(), "bombpot")
|
||||
|
||||
def test_fixer_bombpot_ist_bombpot(self):
|
||||
self.assertEqual(tisch(dict(RING, gameType="BombPot", isFixedHandBombpot=True)).format(), "bombpot")
|
||||
|
||||
def test_doppelbrett_bombpot_bleibt_bombpot(self):
|
||||
self.assertEqual(tisch(dict(RING, isBombpot=True, bombpotInducesDoubleBoard=True)).format(), "bombpot")
|
||||
|
||||
def test_doppelbrett_allein_bleibt_cash(self):
|
||||
self.assertEqual(tisch(dict(RING, isDoubleBoard=True)).format(), "cash")
|
||||
|
||||
|
||||
@unittest.skipUnless(glob.glob(os.path.join(ARCHIV, "main*.log.gz")), "Archiv fehlt")
|
||||
class FormatJeHand(unittest.TestCase):
|
||||
"""Hände, geschnitten wie in tests/ergebnis_spec.py (Hand samt game_alldata des Raums).
|
||||
|
||||
Reference in New Issue
Block a user