Ejemplo n.º 1
0
    def test_three(self):
        # Pair
        HAND_ONE = PokerHand("7D 2C KH 5S KC")
        # Two pair
        HAND_TWO = PokerHand("7D 5C KD KH 7H")

        assert HAND_ONE.compareWith(HAND_TWO) == Result.LOSS
Ejemplo n.º 2
0
    def test_one(self):
        # Pair
        HAND_ONE = PokerHand("AC 4S 5S 8C AH")
        # Pair
        HAND_TWO = PokerHand("4S 5S 8C AS AD")

        assert HAND_ONE.compareWith(HAND_TWO) == Result.TIE
Ejemplo n.º 3
0
    def test_two(self):
        # Flush
        HAND_ONE = PokerHand("KC QC 9C 8C 2C")
        # Pair
        HAND_TWO = PokerHand("4S 5S 8C AS AD")

        assert HAND_ONE.compareWith(HAND_TWO) == Result.WIN
Ejemplo n.º 4
0
 def test_royalflush(self):
     hand = PokerHand("TH JH QH KH AH")
     assert hand.value == Value.ROYAL_FLUSH
Ejemplo n.º 5
0
 def test_pair(self):
     hand = PokerHand("KC KH 7D 2C 5S")
     assert hand.value == Value.PAIR
Ejemplo n.º 6
0
 def test_highcard(self):
     hand = PokerHand("AC 4H 7D KC 2S")
     assert hand.value == Value.HIGHCARD
Ejemplo n.º 7
0
 def test_threeofakind(self):
     hand = PokerHand("KC KH KD 7C 5S")
     assert hand.value == Value.THREE_OF_A_KIND
Ejemplo n.º 8
0
 def test_twopairs(self):
     hand = PokerHand("KC KH 7D 7C 5S")
     assert hand.value == Value.TWO_PAIRS
Ejemplo n.º 9
0
 def test_straight(self):
     hand = PokerHand("3C 4H 5D 6C 7C")
     assert hand.value == Value.STRAIGHT
Ejemplo n.º 10
0
 def test_flush(self):
     hand = PokerHand("KC QC 9C 8C 2C")
     assert hand.value == Value.FLUSH
Ejemplo n.º 11
0
 def test_fullhouse(self):
     hand = PokerHand("KC KH KD 7C 7S")
     assert hand.value == Value.FULL_HOUSE
Ejemplo n.º 12
0
 def test_fourofakind(self):
     hand = PokerHand("KC KH KD KS 5C")
     assert hand.value == Value.FOUR_OF_A_KIND
Ejemplo n.º 13
0
 def test_straightflush(self):
     hand = PokerHand("3C 4C 5C 6C 7C")
     assert hand.value == Value.STRAIGHT_FLUSH