def test_preflop_state1(self): strategy = 'snowie1' # preflop t, p, gui_signals, h, logger = init_table('tests/screenshots/76s.png', strategy=strategy) p = StrategyHandler() p.read_strategy(strategy) l = MagicMock() t.totalPotValue = 0.5 t.equity = 0.5 t.checkButton = False d = Decision(t, h, p, l) t.isHeadsUp = True t.gameStage = "PreFlop" d.__init__(t, h, p, l) d.preflop_table_analyser(t, logger, h, p) preflop_state = CurrentHandPreflopState() bot_preflop_decision = 'Call' d = MagicMock() preflop_state.update_values(t, bot_preflop_decision, h, d) self.assertEqual(t.preflop_sheet_name, '6R4') # flop t, p, gui_signals, h, logger = init_table('tests/screenshots/76ss.png', strategy=strategy) for abs_pos in range(5): if t.other_players[abs_pos]['status'] == 1: sheet_name = preflop_state.get_reverse_sheetname(abs_pos, t, h) self.assertEqual('4', sheet_name)
def test_preflop_state1(self): strategy = 'snowie1' # preflop t, p, gui_signals, h, logger = init_table('tests/screenshots/76s.png', strategy=strategy) p = StrategyHandler() p.read_strategy(strategy) l = MagicMock() t.totalPotValue = 0.5 t.equity = 0.5 t.checkButton = False d = Decision(t, h, p, l) t.isHeadsUp = True t.gameStage = "PreFlop" d.__init__(t, h, p, l) d.preflop_table_analyser(t, logger, h, p) preflop_state = CurrentHandPreflopState() bot_preflop_decision = 'Call' d = MagicMock() preflop_state.update_values(t, bot_preflop_decision, h, d) self.assertEqual(t.preflop_sheet_name, '6R4') # flop t, p, gui_signals, h, logger = init_table('tests/screenshots/76ss.png', strategy=strategy) for abs_pos in range(5): if t.other_players[abs_pos]['status'] == 1: sheet_name = preflop_state.get_reverse_sheetname(abs_pos, t, h) self.assertEqual('4', sheet_name)
def first_round_98h(self): t, p, gui_signals, h, logger = init_table('tests/screenshots/98h.png', strategy='Snowie3', round_number=0) t.checkButton = False d = Decision(t, h, p, l) t.isHeadsUp = True t.gameStage = "PreFlop" d.__init__(t, h, p, l) d.preflop_table_analyser(t, logger, h, p) self.assertEqual(t.preflop_sheet_name, '4R3')
def reverse_init(t,h,p,logger): l = MagicMock() t.totalPotValue = 0.5 t.equity = 0.5 t.checkButton = False d = Decision(t, h, p, l) t.isHeadsUp = True t.gameStage = "PreFlop" d.__init__(t, h, p, l) d.preflop_table_analyser(t, logger, h, p) return d
def sheet_12R4R6(self): t, p, gui_signals, h, logger = init_table('tests/screenshots/12R4R6.png', round_number=1) l = MagicMock() t.checkButton = False d = Decision(t, h, p, l) t.isHeadsUp = True t.gameStage = "PreFlop" d.__init__(t, h, p, l) d.preflop_table_analyser(t, logger, h, p) self.assertEqual(t.preflop_sheet_name, '12R4R6')
def second_round_with_raiser(self): t, p, gui_signals, h, logger = init_table('tests/screenshots/QQ.png', strategy='Snowie3', round_number=1) l = MagicMock() t.checkButton = False d = Decision(t, h, p, l) t.isHeadsUp = True t.gameStage = "PreFlop" d.__init__(t, h, p, l) d.preflop_table_analyser(t, logger, h, p) self.assertEqual(t.preflop_sheet_name, '22R6')
def incorrect_preflop_table2(self): t, p, gui_signals, h, logger = init_table('tests/screenshots/3Ts.png', strategy='Snowie3') l = MagicMock() t.checkButton = False d = Decision(t, h, p, l) t.isHeadsUp = True t.gameStage = "PreFlop" d.__init__(t, h, p, l) d.preflop_table_analyser(t, logger, h, p) self.assertEqual(t.preflop_sheet_name, '6R1C2')
def reverse_init(t, h, p, logger): l = MagicMock() t.totalPotValue = 0.5 t.equity = 0.5 t.checkButton = False d = Decision(t, h, p, l) t.isHeadsUp = True t.gameStage = "PreFlop" d.__init__(t, h, p, l) d.preflop_table_analyser(t, logger, h, p) return d
def test_preflop_round2_3(self): t, p, gui_signals, h, logger = init_table('tests/screenshots/897376414_PreFlop_1.png', round_number=1) p = StrategyHandler() p.read_strategy('Pokemon4') l = MagicMock() t.checkButton = False d = Decision(t, h, p, l) t.isHeadsUp = True t.gameStage = "PreFlop" d.__init__(t, h, p, l) d.preflop_table_analyser(t, logger, h, p) self.assertEqual(t.first_raiser_utg, 2)
def incorrect_preflop_table1(self): t, p, gui_signals, h, logger = init_table('tests/screenshots/K9o.png', strategy='Snowie3') l = MagicMock() t.checkButton = False d = Decision(t, h, p, l) t.isHeadsUp = True t.gameStage = "PreFlop" d.__init__(t, h, p, l) d.preflop_table_analyser(t, logger, h, p) self.assertEqual(t.first_raiser_utg, 4) self.assertEqual(np.isnan(t.second_raiser_utg), True) self.assertEqual(t.preflop_sheet_name, '6R5')
def test_preflop_call_before_raise(self): t, p, gui_signals, h, logger = init_table('tests/screenshots/1791526_PreFlop_0.png', round_number=0) p = StrategyHandler() p.read_strategy('Pokemon4') l = MagicMock() t.checkButton = False d = Decision(t, h, p, l) t.isHeadsUp = True t.gameStage = "PreFlop" d.__init__(t, h, p, l) d.preflop_table_analyser(t, logger, h, p) self.assertEqual(t.first_raiser, 2) self.assertEqual(t.second_raiser, 4) self.assertEqual(t.preflop_sheet_name, '6R5C3')