예제 #1
0
    def test_preflop_betting(self):
        """Sanity test of the preflop betting"""
        bot = MockBot()
        brain = Brain(bot)
        brain.data = self.data

        self.assertEqual(brain.pot_odds(), 12.5) # 20 to call, 140 in the pot
        brain.do_turn(1000)
        self.assertTrue(bot.raise_amount > 0) # shouldn't fold with a pair of aces
예제 #2
0
 def test_river_betting(self):
     """Sanity tests of betting with common cards"""
     self.data.table_cards = [Card(C.ACE, C.SPADES),
                              Card(2, C.DIAMONDS),
                              Card(7, C.SPADES)]
     bot = MockBot()
     brain = Brain(bot)
     brain.data = self.data
     brain.iterations = 100 # smaller for unit tests
     brain.do_turn(500)
     self.assertTrue(bot.raise_amount > 0)