예제 #1
0
def test_table_take_blinds():
    table = Table()
    num_players = 3
    players = []
    for i in xrange(num_players):
        player = Player(10)
        player.sit(table, i)
        players.append(player)
    table.initialize_hand()
    table.incr_action()
    table.take_blinds()
    # This will have to change when I support more types of games
    assert table.pots[0].round_bets == {1: 1, 2: 2, 0: None}
    assert table.action == 2
예제 #2
0
def test_table_pots_need_action():
    table = Table()
    num_players = 3
    players = []
    for i in xrange(num_players):
        player = Player(10)
        player.sit(table, i)
        players.append(player)
    table.initialize_hand()
    table.incr_action()
    table.take_blinds()
    assert table.pots_need_action(0)
    assert table.pots_need_action(1)
    assert not table.pots_need_action(2)
예제 #3
0
def test_table_take_blinds():
    table = Table()
    num_players = 3
    players = []
    for i in xrange(num_players):
        player = Player(10)
        player.sit(table, i)
        players.append(player)
    table.initialize_hand()
    table.incr_action()
    table.take_blinds()
    # This will have to change when I support more types of games
    assert table.pots[0].round_bets == {1: 1, 2: 2, 0: None}
    assert table.action == 2
예제 #4
0
def test_table_pots_need_action():
    table = Table()
    num_players = 3
    players = []
    for i in xrange(num_players):
        player = Player(10)
        player.sit(table, i)
        players.append(player)
    table.initialize_hand()
    table.incr_action()
    table.take_blinds()
    assert table.pots_need_action(0)
    assert table.pots_need_action(1)
    assert not table.pots_need_action(2)
예제 #5
0
def test_table_run_betting_round():
    table = Table()
    # Dealer will bet first preflop, so 2 will win as for now all players will fold
    num_players = 3
    players = []
    for i in xrange(num_players):
        player = Player(10)
        player.sit(table, i)
        players.append(player)
    table.initialize_hand()
    table.incr_action()
    table.take_blinds()
    winner = table.run_betting_round()
    assert winner == 2
    assert len(table.pots) == 1
    assert table.pots[0].chips == 3  # For a 1/2 limit game
예제 #6
0
def test_table_run_betting_round():
    table = Table()
    # Dealer will bet first preflop, so 2 will win as for now all players will fold
    num_players = 3
    players = []
    for i in xrange(num_players):
        player = Player(10)
        player.sit(table, i)
        players.append(player)
    table.initialize_hand()
    table.incr_action()
    table.take_blinds()
    winner = table.run_betting_round()
    assert winner == 2
    assert len(table.pots) == 1
    assert table.pots[0].chips == 3 # For a 1/2 limit game