Пример #1
0
def test_table_take_bet_two_skim_bets():
    table = Table()
    player = Player(3)
    player.sit(table, 0)
    player = Player(4)
    player.sit(table, 3)
    for i in (1, 2):
        player = Player(10)
        player.sit(table, i)

    table.initialize_hand()
    table.incr_action()
    table.take_bet(5)
    assert len(table.pots) == 1
    assert table.pots[0].round_bets == {1: 5, 0: None, 2: None, 3: None}
    table.incr_action()
    table.take_bet(6)
    assert len(table.pots) == 1
    assert table.pots[0].round_bets == {1: 5, 0: None, 2: 6, 3: None}
    table.incr_action()
    table.take_bet(6)
    assert len(table.pots) == 2
    assert table.pots[0].round_bets == {1: 4, 0: None, 2: 4, 3: 4}
    assert table.pots[1].round_bets == {1: 1, 2: 2, 0: None}
    table.incr_action()
    table.take_bet(6)
    assert len(table.pots) == 3
    assert table.pots[0].round_bets == {1: 3, 0: 3, 2: 3, 3: 3}
    assert table.pots[1].round_bets == {1: 1, 2: 1, 3: 1}
    assert table.pots[2].round_bets == {1: 1, 2: 2}
Пример #2
0
def test_table_take_bet_two_skim_bets():
    table = Table()
    player = Player(3)
    player.sit(table, 0)
    player = Player(4)
    player.sit(table, 3)
    for i in (1, 2):
        player = Player(10)
        player.sit(table, i)

    table.initialize_hand()
    table.incr_action()
    table.take_bet(5)
    assert len(table.pots) == 1
    assert table.pots[0].round_bets == {1: 5, 0: None, 2: None, 3: None}
    table.incr_action()
    table.take_bet(6)
    assert len(table.pots) == 1
    assert table.pots[0].round_bets == {1: 5, 0: None, 2: 6, 3: None}
    table.incr_action()
    table.take_bet(6)
    assert len(table.pots) == 2
    assert table.pots[0].round_bets == {1: 4, 0: None, 2: 4, 3: 4}
    assert table.pots[1].round_bets == {1: 1, 2: 2, 0: None}
    table.incr_action()
    table.take_bet(6)
    assert len(table.pots) == 3
    assert table.pots[0].round_bets == {1: 3, 0: 3, 2: 3, 3: 3}
    assert table.pots[1].round_bets == {1: 1, 2: 1, 3: 1}
    assert table.pots[2].round_bets == {1: 1, 2: 2}
Пример #3
0
def test_table_take_bet_skim():
    table = Table()
    player = Player(4)
    player.sit(table, 0)
    for i in (1, 2):
        player = Player(10)
        player.sit(table, i)

    table.initialize_hand()
    table.incr_action()
    table.take_bet(5)
    assert len(table.pots) == 1
    assert table.pots[0].round_bets == {1: 5, 0: None, 2: None}
    table.incr_action()
    table.take_bet(6)
    assert len(table.pots) == 1
    assert table.pots[0].round_bets == {1: 5, 0: None, 2: 6}
    table.incr_action()
    table.take_bet(6)
    assert len(table.pots) == 2
    assert table.pots[0].round_bets == {1: 4, 0: 4, 2: 4}
    assert table.pots[1].round_bets == {1: 1, 2: 2}
    assert table.players[0].chips == 0
    assert table.players[1].chips == 5
    assert table.players[2].chips == 4
Пример #4
0
def test_table_take_bet_skim():
    table = Table()
    player = Player(4)
    player.sit(table, 0)
    for i in (1, 2):
        player = Player(10)
        player.sit(table, i)

    table.initialize_hand()
    table.incr_action()
    table.take_bet(5)
    assert len(table.pots) == 1
    assert table.pots[0].round_bets == {1: 5, 0: None, 2: None}
    table.incr_action()
    table.take_bet(6)
    assert len(table.pots) == 1
    assert table.pots[0].round_bets == {1: 5, 0: None, 2: 6}
    table.incr_action()
    table.take_bet(6)
    assert len(table.pots) == 2
    assert table.pots[0].round_bets == {1: 4, 0: 4, 2: 4}
    assert table.pots[1].round_bets == {1: 1, 2: 2}
    assert table.players[0].chips == 0
    assert table.players[1].chips == 5
    assert table.players[2].chips == 4
Пример #5
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]
Пример #6
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]
Пример #7
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]
Пример #8
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]