示例#1
0
def test_table_take_rake_at_limit():
    table = Table()
    for i in (1, 2, 3, 4):
        player = Player(100)
        player.sit(table, i)

    table.initialize_hand()
    table.incr_action()
    table.take_bet(100)
    table.incr_action()
    table.take_bet(100)
    table.incr_action()
    table.take_bet(100)
    table.incr_action()
    table.take_bet(100)
    for pot in table.pots:
        pot.end_round()
    table.take_rake()
    assert table.rake == [5]
示例#2
0
def test_table_take_rake_at_limit():
    table = Table()
    for i in (1, 2, 3, 4):
        player = Player(100)
        player.sit(table, i)

    table.initialize_hand()
    table.incr_action()
    table.take_bet(100)
    table.incr_action()
    table.take_bet(100)
    table.incr_action()
    table.take_bet(100)
    table.incr_action()
    table.take_bet(100)
    for pot in table.pots:
        pot.end_round()
    table.take_rake()
    assert table.rake == [5]
示例#3
0
def test_table_take_rake_with_skim():
    table = Table()
    for i in (1, 2, 3):
        player = Player(100)
        player.sit(table, i)
    player = Player(10)
    player.sit(table, 0)

    table.initialize_hand()
    table.incr_action()
    table.take_bet(25)
    table.incr_action()
    table.take_bet(25)
    table.incr_action()
    table.take_bet(25)
    table.incr_action()
    table.take_bet(11)  # Gets skimmed to 10
    assert len(table.pots) == 2
    assert table.pots[0].round_bets == {1: 10, 0: 10, 2: 10, 3: 10}
    assert table.pots[1].round_bets == {1: 15, 2: 15, 3: 15}
    for pot in table.pots:
        pot.end_round()
    table.take_rake()
    assert table.rake == [4, 1]
示例#4
0
def test_table_take_rake_with_skim():
    table = Table()
    for i in (1, 2, 3):
        player = Player(100)
        player.sit(table, i)
    player = Player(10)
    player.sit(table, 0)

    table.initialize_hand()
    table.incr_action()
    table.take_bet(25)
    table.incr_action()
    table.take_bet(25)
    table.incr_action()
    table.take_bet(25)
    table.incr_action()
    table.take_bet(11) # Gets skimmed to 10
    assert len(table.pots) == 2
    assert table.pots[0].round_bets == {1: 10, 0: 10, 2: 10, 3: 10}
    assert table.pots[1].round_bets == {1: 15, 2: 15, 3: 15}
    for pot in table.pots:
        pot.end_round()
    table.take_rake()
    assert table.rake == [4, 1]