Files
pokerfreak/tests/rein_gegen_spec.py

22 lines
1.4 KiB
Python

#!/usr/bin/env python3
"""MOTOR_REIN_GEGEN (29.11.): seltene Erhoehung gegen Einsatz auf Flop/Turn (Baum) wird Fold/Call. python3 tests/rein_gegen_spec.py"""
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "entscheiden"))
import schatten as S
Q = {"street": "FLOP", "toCall": 0.23}
R = {"action": "ALL_IN", "size": 5.0, "reason": "motor FLOP (2 im Topf, Klasse 1507): fold 85%, call 0%, all-in 15%"}
os.environ.pop("MOTOR_REIN_GEGEN", None)
assert S.rein_gegen(Q, R) is R # aus: unveraendert
os.environ["MOTOR_REIN_GEGEN"] = "1"
assert S.rein_gegen(Q, R)["action"] == "FOLD" and "size" not in S.rein_gegen(Q, R)
assert S.rein_gegen(Q, R)["reason"].startswith("REIN_GEGEN")
assert S.rein_gegen(Q, dict(R, reason="motor FLOP: fold 10%, call 75%, 0.80x 15%"))["action"] == "CALL"
assert S.rein_gegen(dict(Q, toCall=0), R)["action"] == "ALL_IN" # ohne Einsatz bleibt sie
assert S.rein_gegen(Q, dict(R, reason="motor TURN genau (800 ms): Fold 85%, AllIn 15%"))["action"] == "ALL_IN"
assert S.rein_gegen(Q, dict(R, reason="motor preis: x"))["action"] == "ALL_IN"
assert S.rein_gegen(Q, dict(R, reason="motor FLOP: fold 50%, call 0%, all-in 50%"))["action"] == "ALL_IN"
assert S.rein_gegen(dict(Q, street="RIVER"), R)["action"] == "ALL_IN"
print("rein_gegen_spec: gruen")