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())
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)
def testIsNotStraightFlush(self): hand = FullHand(("as", "9s"), ("qs", "jd", "4s", "10h", "9c")) self.assertFalse(hand.is_straight_flush())
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())
def testIsNotFullHouse(self): hand = FullHand(("as", "9s"), ("qs", "jd", "4s", "10d", "9s")) self.assertFalse(hand.is_full_house())
def testIsOnePair(self): hand = FullHand(("as", "9s"), ("qs", "ad", "4s", "6h", "8c")) self.assertTrue(hand.is_one_pair())
def testIsFlush(self): hand = FullHand(("as", "9s"), ("qs", "js", "4s", "6c", "jd")) self.assertTrue(hand.is_flush())
def testIsStraightFlushButNotRoyal(self): hand = FullHand(("as", "6d"), ("5d", "4d", "3d", "2d")) self.assertFalse(hand.is_royal())
def testIsNotTrips(self): hand = FullHand(("as", "9s"), ("qs", "jd", "4s", "10d", "8s")) self.assertFalse(hand.is_trips())
def testIsTrips(self): hand = FullHand(("as", "js"), ("ad", "kc", "ac", "10d", "9s")) self.assertTrue(hand.is_trips())
def testIsNotTwoPair(self): hand = FullHand(("as", "9s"), ("qs", "jd", "4s", "6s", "7h")) self.assertFalse(hand.is_two_pair())
def testIsTwoPair(self): hand = FullHand(("as", "ks"), ("ad", "kc", "9h", "jd", "5c")) self.assertTrue(hand.is_two_pair())
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())
def testIsQuads(self): hand = FullHand(("as", "ks"), ("ad", "ac", "ah", "10d", "9s")) self.assertTrue(hand.is_quads())
def testLowStraightFlush(self): hand = FullHand(("as", "6d"), ("5d", "4d", "3d", "2d")) self.assertTrue(hand.is_straight_flush())
def testIsStraight(self): hand = FullHand(("as", "js"), ("qd", "kc", "10c", "4h", "4h")) self.assertTrue(hand.is_straight())
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())
def testIsRoyalNotRoyal(self): hand = FullHand(("as", "kd"), ("qd", "jd", "10d", "10s", "7h")) self.assertFalse(hand.is_royal())
def testIsStraightAceLow(self): hand = FullHand(("as", "3s"), ("2d", "4c", "5c", "kd", "6c")) self.assertTrue(hand.is_straight())
def testIsNotFlush(self): hand = FullHand(("as", "9s"), ("qs", "jd", "4s", "6c", "8h")) self.assertFalse(hand.is_flush())
def testIsStraightAceHighAndDeuce(self): hand = FullHand(["2d", "kd"], ["qd", "as", "th", "4d", "js"]) self.assertTrue(hand.is_straight())
def testIsNotOnePair(self): hand = FullHand(("as", "9s"), ("qs", "jd", "4s", "6h", "8c")) self.assertFalse(hand.is_one_pair())
def testIsFullHouse(self): hand = FullHand(("as", "ks"), ("kd", "ad", "ac", "10d", "9s")) self.assertTrue(hand.is_full_house())