Exemplo n.º 1
0
def test_heads_up():
    #given
    high_card_jack = ph.PokerHand("JH 9D 5C 3S 7H")
    high_card_jack_2 = ph.PokerHand("JD TC 8D 6C 3C")
    # when
    result = ph.heads_up(high_card_jack, high_card_jack_2)
    # then
    assert result == 2

    #given
    high_card_jack = ph.PokerHand("JH 6D 5C 3S 7H")
    one_pair = ph.PokerHand("TH TC 7D 6C 3C")
    # when
    result = ph.heads_up(one_pair, high_card_jack)
    # then
    assert result == 1

    #given
    pair_of_jacks = ph.PokerHand("JH JD 5C 3S 7H")
    pair_of_jacks_ace_high = ph.PokerHand("JC JS AD 6C 3C")
    # when
    result = ph.heads_up(pair_of_jacks, pair_of_jacks_ace_high)
    # then
    assert result == 2

    # given
    sixes_over_nines = ph.PokerHand("6H 6C 6D 9H 9S")
    sevens_over_tens = ph.PokerHand("TH TD 7C 7H 7S")
    # when
    result = ph.heads_up(sixes_over_nines, sevens_over_tens)
    # then
    assert result == 2
Exemplo n.º 2
0
def junk_hand():
    return ph.PokerHand("2H 4C 6S 9D JH")
Exemplo n.º 3
0
def one_pair():
    return ph.PokerHand("QH JS TC TD 7H")
Exemplo n.º 4
0
def royal_flush():
    return ph.PokerHand("TC JC QC KC AC")
Exemplo n.º 5
0
def three_of_a_kind():
    return ph.PokerHand("TH TS TD JC 9H")
Exemplo n.º 6
0
def two_pair():
    return ph.PokerHand("QH QS TC TD 7H")
Exemplo n.º 7
0
def flush():
    return ph.PokerHand("8H 6H 2H 3H TH")
Exemplo n.º 8
0
def straight():
    return ph.PokerHand("2H 3C 4S 5D 6H")
Exemplo n.º 9
0
def full_house():
    return ph.PokerHand("6H 6C 6S 9D 9H")
Exemplo n.º 10
0
def four_of_a_kind():
    return ph.PokerHand("JH JC JS JD 8H")
Exemplo n.º 11
0
def straight_flush():
    return ph.PokerHand("8H 6H 7H 9H TH")