예제 #1
0
 def testComplicatedIsStraightFlush(self):
     # Possible to have cards that compose a flush and a straight, but not
     # a straight flush:
     hand = FullHand(("9s", "10c"), ("js", "qs", "ks", "5d", "2s"))
     self.assertTrue(hand.is_straight())
     self.assertTrue(hand.is_flush())
     self.assertFalse(hand.is_straight_flush())
예제 #2
0
    def testQuadsGreaterThanFullHouse(self):
        board = ("ks", "kd", "kh", "6s", "6c")
        hand1 = FullHand(("as", "kc"), board)
        hand2 = FullHand(("9s", "9d"), board)

        self.assertTrue(hand1.is_quads())
        self.assertTrue(hand2.is_full_house())
        self.assertFalse(hand2.is_quads())
        self.assertHandGreaterThan(hand1, hand2)
예제 #3
0
 def testIsNotStraightFlush(self):
     hand = FullHand(("as", "9s"), ("qs", "jd", "4s", "10h", "9c"))
     self.assertFalse(hand.is_straight_flush())
예제 #4
0
 def testIsStraightFlush(self):
     hand = FullHand(("9s", "js"), ("10s", "ks", "qs", "9c", "jd"))
     self.assertTrue(hand.is_straight())
     self.assertTrue(hand.is_flush())
     self.assertTrue(hand.is_straight_flush())
예제 #5
0
 def testIsNotFullHouse(self):
     hand = FullHand(("as", "9s"), ("qs", "jd", "4s", "10d", "9s"))
     self.assertFalse(hand.is_full_house())
예제 #6
0
 def testIsOnePair(self):
     hand = FullHand(("as", "9s"), ("qs", "ad", "4s", "6h", "8c"))
     self.assertTrue(hand.is_one_pair())
예제 #7
0
 def testIsFlush(self):
     hand = FullHand(("as", "9s"), ("qs", "js", "4s", "6c", "jd"))
     self.assertTrue(hand.is_flush())
예제 #8
0
 def testIsStraightFlushButNotRoyal(self):
     hand = FullHand(("as", "6d"), ("5d", "4d", "3d", "2d"))
     self.assertFalse(hand.is_royal())
예제 #9
0
 def testIsNotTrips(self):
     hand = FullHand(("as", "9s"), ("qs", "jd", "4s", "10d", "8s"))
     self.assertFalse(hand.is_trips())
예제 #10
0
 def testIsTrips(self):
     hand = FullHand(("as", "js"), ("ad", "kc", "ac", "10d", "9s"))
     self.assertTrue(hand.is_trips())
예제 #11
0
 def testIsNotTwoPair(self):
     hand = FullHand(("as", "9s"), ("qs", "jd", "4s", "6s", "7h"))
     self.assertFalse(hand.is_two_pair())
예제 #12
0
 def testIsTwoPair(self):
     hand = FullHand(("as", "ks"), ("ad", "kc", "9h", "jd", "5c"))
     self.assertTrue(hand.is_two_pair())
예제 #13
0
    def testIsNotQuads(self):
        hand = FullHand(("as", "9s"), ("qs", "jd", "4s", "10d", "8c"))
        self.assertFalse(hand.is_quads())

        hand = FullHand(("9c", "9s"), ("qs", "qd", "qh", "10d", "8c"))
        self.assertFalse(hand.is_quads())
예제 #14
0
 def testIsQuads(self):
     hand = FullHand(("as", "ks"), ("ad", "ac", "ah", "10d", "9s"))
     self.assertTrue(hand.is_quads())
예제 #15
0
 def testLowStraightFlush(self):
     hand = FullHand(("as", "6d"), ("5d", "4d", "3d", "2d"))
     self.assertTrue(hand.is_straight_flush())
예제 #16
0
 def testIsStraight(self):
     hand = FullHand(("as", "js"), ("qd", "kc", "10c", "4h", "4h"))
     self.assertTrue(hand.is_straight())
예제 #17
0
    def testIsNotStraight(self):
        hand = FullHand(("as", "9s"), ("qs", "jd", "4s", "4h", "6c"))
        self.assertFalse(hand.is_straight())

        hand = FullHand(("qh", "4d"), ("as", "5s", "js", "10c", "9d"))
        self.assertFalse(hand.is_straight())
예제 #18
0
 def testIsRoyalNotRoyal(self):
     hand = FullHand(("as", "kd"), ("qd", "jd", "10d", "10s", "7h"))
     self.assertFalse(hand.is_royal())
예제 #19
0
 def testIsStraightAceLow(self):
     hand = FullHand(("as", "3s"), ("2d", "4c", "5c", "kd", "6c"))
     self.assertTrue(hand.is_straight())
예제 #20
0
 def testIsNotFlush(self):
     hand = FullHand(("as", "9s"), ("qs", "jd", "4s", "6c", "8h"))
     self.assertFalse(hand.is_flush())
예제 #21
0
 def testIsStraightAceHighAndDeuce(self):
     hand = FullHand(["2d", "kd"], ["qd", "as", "th", "4d", "js"])
     self.assertTrue(hand.is_straight())
예제 #22
0
 def testIsNotOnePair(self):
     hand = FullHand(("as", "9s"), ("qs", "jd", "4s", "6h", "8c"))
     self.assertFalse(hand.is_one_pair())
예제 #23
0
 def testIsFullHouse(self):
     hand = FullHand(("as", "ks"), ("kd", "ad", "ac", "10d", "9s"))
     self.assertTrue(hand.is_full_house())