Esempio n. 1
0
def test_straight_against_trips():
    """Testing a royal straight."""
    hand_amount = 3
    hands_array = ['J', '♣', 'Q', '♣', 'T', '♠', '5', '♦', 'A', '♠', 'A', '♣']
    ftr = ['T', '♦', 'K', '♦', '4', '♥', 'A', '♦', '6', '♠']
    result = main.testing_function(hand_amount, hands_array, ftr)
    assert result[0] == [1]
    assert result[1] == [5, 2, 4]
Esempio n. 2
0
def test_royal_flush_coverage():
    """A general test for royal flush to gain coverage."""
    hand_amount = 3
    hands_array = ['4', '♣', '2', '♣', '6', '♦', 'Q', '♣', '5', '♦', '9', '♦']
    ftr = ['T', '♣', 'J', '♣', 'Q', '♦', 'K', '♣', 'A', '♣']
    result = main.testing_function(hand_amount, hands_array, ftr)
    assert result[0] == [2]
    assert result[1] == [6, 10, 5]
Esempio n. 3
0
def test_pair_on_board_high_card():
    """Testing pair on the board with a high card win."""
    hand_amount = 3
    hands_array = ['4', '♣', '5', '♥', '3', '♥', '5', '♠', '6', '♥', 'T', '♥']
    ftr = ['K', '♦', 'K', '♣', 'J', '♦', '8', '♦', '7', '♥']
    result = main.testing_function(hand_amount, hands_array, ftr)
    assert result[0] == [3]
    assert result[1] == [2, 2, 2]
Esempio n. 4
0
def test_high_cards_on_board():
    """Testing the board containing all five high cards."""
    hand_amount = 2
    hands_array = ['4', '♣', '2', '♣', '6', '♠', '5', '♠']
    ftr = ['K', '♦', 'Q', '♦', 'J', '♦', '8', '♦', 'A', '♥']
    result = main.testing_function(hand_amount, hands_array, ftr)
    assert result[0] == [1, 2]
    assert result[1] == [1, 1]
Esempio n. 5
0
def test_royal_flush_against_straight_flush():
    """Testing a royal flush against a straight flush."""
    hand_amount = 3
    hands_array = ['4', '♣', '2', '♣', 'K', '♦', 'A', '♦', '8', '♦', '9', '♦']
    ftr = ['6', '♣', '7', '♥', 'T', '♦', 'J', '♦', 'Q', '♦']
    result = main.testing_function(hand_amount, hands_array, ftr)
    assert result[0] == [2]
    assert result[1] == [1, 10, 9]
Esempio n. 6
0
def test_straight_flush_split():
    """Testing a split between all hands for a straight flush."""
    hand_amount = 3
    hands_array = ['4', '♣', '2', '♣', '8', '♦', '5', '♦', 'A', '♠', '4', '♦']
    ftr = ['K', '♦', 'Q', '♦', 'J', '♦', '9', '♦', 'T', '♦']
    result = main.testing_function(hand_amount, hands_array, ftr)
    assert result[0] == [1, 2, 3]
    assert result[1] == [9, 9, 9]
Esempio n. 7
0
def test_straight_flush_on_board_one_overcard():
    """Testing a straight flush win where one has a better straight flush."""
    hand_amount = 3
    hands_array = ['4', '♣', '2', '♣', '7', '♦', '6', '♦', '2', '♠', 'K', '♦']
    ftr = ['8', '♦', 'Q', '♦', 'J', '♦', '9', '♦', 'T', '♦']
    result = main.testing_function(hand_amount, hands_array, ftr)
    assert result[0] == [3]
    assert result[1] == [9, 9, 9]
Esempio n. 8
0
def test_full_house_win_2():
    """Testing another full house win."""
    hand_amount = 3
    hands_array = ['6', '♥', '6', '♦', '2', '♥', '2', '♠', '3', '♠', '5', '♥']
    ftr = ['K', '♦', 'A', '♠', '7', '♦', '7', '♠', '7', '♣']
    result = main.testing_function(hand_amount, hands_array, ftr)
    assert result[0] == [1]
    assert result[1] == [7, 7, 4]
Esempio n. 9
0
def test_full_house_split():
    """Testing a full house split pot amongst two hands."""
    hand_amount = 3
    hands_array = ['Q', '♥', '4', '♦', '3', '♠', '3', '♥', 'Q', '♣', 'K', '♠']
    ftr = ['Q', '♦', 'Q', '♠', '3', '♦', '4', '♥', '4', '♣']
    result = main.testing_function(hand_amount, hands_array, ftr)
    assert result[0] == [1, 3]
    assert result[1] == [7, 7, 7]
Esempio n. 10
0
def test_flush_split_pot():
    """Testing a split pot for a flush - against a straight also."""
    hand_amount = 3
    hands_array = ['T', '♥', 'J', '♥', '2', '♥', '5', '♥', '3', '♥', '7', '♥']
    ftr = ['K', '♠', 'Q', '♠', '7', '♠', '8', '♠', '9', '♠']
    result = main.testing_function(hand_amount, hands_array, ftr)
    assert result[0] == [1, 2, 3]
    assert result[1] == [6, 6, 6]
Esempio n. 11
0
def test_full_house_win():
    """Testing a full house win."""
    hand_amount = 3
    hands_array = ['T', '♥', 'T', '♦', '2', '♥', '5', '♠', '3', '♠', '7', '♥']
    ftr = ['Q', '♦', 'Q', '♠', '7', '♦', '7', '♠', 'T', '♣']
    result = main.testing_function(hand_amount, hands_array, ftr)
    assert result[0] == [1]
    assert result[1] == [7, 3, 7]
Esempio n. 12
0
def test_flush_winner_fifth_card():
    """Testing a flush win because of the 5th flush card."""
    hand_amount = 3
    hands_array = ['2', '♦', '6', '♦', '6', '♥', '7', '♥', '3', '♥', '7', '♦']
    ftr = ['K', '♦', 'Q', '♦', '5', '♥', '8', '♦', '9', '♦']
    result = main.testing_function(hand_amount, hands_array, ftr)
    assert result[0] == [3]
    assert result[1] == [6, 5, 6]
Esempio n. 13
0
def test_flush_single_winner():
    """Testing an ace high flush winner."""
    hand_amount = 3
    hands_array = ['J', '♦', 'A', '♦', '3', '♠', '3', '♦', 'K', '♦', '7', '♦']
    ftr = ['T', '♦', 'Q', '♦', '4', '♥', '4', '♦', '6', '♠']
    result = main.testing_function(hand_amount, hands_array, ftr)
    assert result[0] == [1]
    assert result[1] == [6, 3, 6]
Esempio n. 14
0
def test_ace_low_straight():
    """Testing Ace Low Straight."""
    hand_amount = 3
    hands_array = ['A', '♣', '2', '♣', '9', '♠', '5', '♦', '8', '♠', 'K', '♦']
    ftr = ['3', '♦', '4', '♦', '5', '♥', 'K', '♦', '8', '♠']
    result = main.testing_function(hand_amount, hands_array, ftr)
    assert result[0] == [1]
    assert result[1] == [5, 2, 3]
Esempio n. 15
0
def test_four_of_a_kind_three_on_board():
    """Testing a four of a kind, where three of a kind is on the board."""
    hand_amount = 2
    hands_array = ['A', '♥', '5', '♣', '9', '♣', '9', '♦']
    ftr = ['A', '♦', 'A', '♠', '3', '♦', '4', '♦', 'A', '♣']
    result = main.testing_function(hand_amount, hands_array, ftr)
    assert result[0] == [1]
    assert result[1] == [8, 7]
Esempio n. 16
0
def test_full_house_on_board_split():
    """Testing a full house on the board, with a split pot."""
    hand_amount = 3
    hands_array = ['A', '♥', '4', '♥', '7', '♣', '7', '♠', '6', '♠', '6', '♥']
    ftr = ['K', '♦', 'K', '♠', 'K', '♥', '9', '♥', '9', '♣']
    result = main.testing_function(hand_amount, hands_array, ftr)
    assert result[0] == [1, 2, 3]
    assert result[1] == [7, 7, 7]
Esempio n. 17
0
def test_straight_flush_win():
    """Testing a straight flush, single winner."""
    hand_amount = 3
    hands_array = ['4', '♣', '2', '♦', '9', '♦', '5', '♦', '7', '♠', '6', '♥']
    ftr = ['6', '♦', '7', '♥', '7', '♦', 'K', '♦', '8', '♦']
    result = main.testing_function(hand_amount, hands_array, ftr)
    assert result[0] == [2]
    assert result[1] == [6, 9, 7]
Esempio n. 18
0
def test_full_house_on_board_winner():
    """Testing a full house on the board, but there's a winner with a higher pair val."""
    hand_amount = 3
    hands_array = ['A', '♥', '4', '♥', '7', '♣', '7', '♠', 'T', '♠', 'T', '♥']
    ftr = ['K', '♦', 'K', '♠', 'K', '♥', '9', '♥', '9', '♣']
    result = main.testing_function(hand_amount, hands_array, ftr)
    assert result[0] == [3]
    assert result[1] == [7, 7, 7]
Esempio n. 19
0
def test_straight_flush_overcard_winner():
    """Testing a straight flush win, higher straight value."""
    hand_amount = 3
    hands_array = ['4', '♣', '2', '♣', 'K', '♦', '5', '♦', '2', '♠', '8', '♦']
    ftr = ['8', '♠', 'Q', '♦', 'J', '♦', '9', '♦', 'T', '♦']
    result = main.testing_function(hand_amount, hands_array, ftr)
    assert result[0] == [2]
    assert result[1] == [5, 9, 9]
Esempio n. 20
0
def test_four_of_a_kind_winner():
    """Testing a single four of a kind winner."""
    hand_amount = 3
    hands_array = ['2', '♥', '2', '♣', '7', '♣', '7', '♠', 'T', '♠', 'T', '♥']
    ftr = ['2', '♦', '7', '♦', 'T', '♦', '9', '♣', '2', '♠']
    result = main.testing_function(hand_amount, hands_array, ftr)
    assert result[0] == [1]
    assert result[1] == [8, 7, 7]
Esempio n. 21
0
def test_straight_flush_ace_low():
    """Testing an ace low straight flush."""
    hand_amount = 3
    hands_array = ['4', '♣', '2', '♣', 'K', '♦', '5', '♦', 'A', '♠', 'A', '♥']
    ftr = ['A', '♣', '3', '♣', '5', '♣', 'A', '♦', '2', '♦']
    result = main.testing_function(hand_amount, hands_array, ftr)
    assert result[0] == [1]
    assert result[1] == [9, 3, 8]
Esempio n. 22
0
def test_four_of_a_kind_2():
    """Testing a four of a kind, where three of the cards are on the board."""
    hand_amount = 3
    hands_array = ['2', '♥', '7', '♣', '6', '♣', '8', '♠', 'T', '♠', 'J', '♥']
    ftr = ['2', '♦', '7', '♦', 'Q', '♦', '2', '♣', '2', '♠']
    result = main.testing_function(hand_amount, hands_array, ftr)
    assert result[0] == [1]
    assert result[1] == [8, 4, 4]
Esempio n. 23
0
def test_straight_flush_ace_low_comparison():
    """Testing two straight flushes where one is an ace low."""
    hand_amount = 2
    hands_array = ['A', '♦', '9', '♦', '6', '♦', 'Q', '♦']
    ftr = ['2', '♦', '3', '♦', '4', '♦', '5', '♦', 'K', '♦']
    result = main.testing_function(hand_amount, hands_array, ftr)
    assert result[0] == [2]
    assert result[1] == [9, 9]
Esempio n. 24
0
def test_high_card_split_pot():
    """Testing high card split pot."""
    hand_amount = 3
    hands_array = ['4', '♣', 'J', '♣', '9', '♠', '5', '♦', '2', '♠', 'J', '♦']
    ftr = ['3', '♦', 'T', '♦', '7', '♥', 'K', '♦', '8', '♠']
    result = main.testing_function(hand_amount, hands_array, ftr)
    assert result[0] == [1, 3]
    assert result[1] == [1, 1, 1]
Esempio n. 25
0
def test_royal_flush_on_board():
    """Testing a royal flush on the board - split pot - will probably never happen!"""
    hand_amount = 3
    hands_array = ['4', '♣', '2', '♣', 'K', '♦', 'A', '♦', 'Q', '♦', '9', '♦']
    ftr = ['T', '♣', 'J', '♣', 'Q', '♣', 'K', '♣', 'A', '♣']
    result = main.testing_function(hand_amount, hands_array, ftr)
    assert result[0] == [1, 2, 3]
    assert result[1] == [10, 10, 10]
Esempio n. 26
0
def test_four_of_a_kind_ace_two():
    """Testing a four of a kind against twos and aces."""
    hand_amount = 3
    hands_array = ['A', '♥', 'A', '♣', '2', '♣', '2', '♦', '4', '♣', '5', '♦']
    ftr = ['A', '♦', 'A', '♠', '3', '♦', '2', '♥', '2', '♠']
    result = main.testing_function(hand_amount, hands_array, ftr)
    assert result[0] == [1]
    assert result[1] == [8, 8, 5]
Esempio n. 27
0
def test_pocket_aces():
    """Testing a simple pocket aces win."""
    hand_amount = 3
    hands_array = ['A', '♣', 'A', '♠', '3', '♥', '5', '♠', '6', '♥', 'T', '♥']
    ftr = ['K', '♦', 'Q', '♦', 'J', '♦', '8', '♦', '7', '♥']
    result = main.testing_function(hand_amount, hands_array, ftr)
    assert result[0] == [1]
    assert result[1] == [2, 1, 1]
Esempio n. 28
0
def test_four_of_a_kind_split():
    """Testing a split pot, four of a kind."""
    hand_amount = 3
    hands_array = ['A', '♥', '5', '♣', '9', '♣', '9', '♠', 'A', '♠', 'A', '♣']
    ftr = ['8', '♦', '8', '♦', '8', '♦', '9', '♦', '8', '♠']
    result = main.testing_function(hand_amount, hands_array, ftr)
    assert result[0] == [1, 3]
    assert result[1] == [8, 8, 8]
Esempio n. 29
0
def test_split_pair():
    """Testing two pocket pairs split pot."""
    hand_amount = 2
    hands_array = ['4', '♣', '4', '♥', '4', '♦', '4', '♠']
    ftr = ['K', '♦', '2', '♣', 'J', '♦', '8', '♦', '7', '♥']
    result = main.testing_function(hand_amount, hands_array, ftr)
    assert result[0] == [1, 2]
    assert result[1] == [2, 2]
Esempio n. 30
0
def test_split_straight():
    """Testing Split Straight."""
    hand_amount = 3
    hands_array = ['J', '♣', 'Q', '♣', '9', '♠', '5', '♦', '2', '♠', 'J', '♦']
    ftr = ['6', '♦', 'T', '♦', 'Q', '♥', 'K', '♦', 'A', '♠']
    result = main.testing_function(hand_amount, hands_array, ftr)
    assert result[0] == [1, 3]
    assert result[1] == [5, 1, 5]