Esempio n. 1
0
 def test_getHighCard(self):
     c = card.cards()
     cards = orderedCards.OrderedCards(
         [c._5c, c._2s, c._10d, c._4c, c._6d, c._js, c._9h, c._7d])
     output_hand = evalHand(cards)
     self.assertEqual(output_hand.handType, HandType.high_card)
     self.assertEqual(output_hand.vals, [11, 10, 9, 7, 6])
Esempio n. 2
0
 def test_getFlush(self):
     c = card.cards()
     cards = orderedCards.OrderedCards(
         [c._5d, c._2d, c._10d, c._4d, c._6d, c._js, c._9d, c._7d])
     #output_hand = getStraightFlushOrFlush(classifyCardsBySuit(cards))
     output_hand = evalHand(cards)
     self.assertEqual(output_hand.handType, HandType.flush)
     self.assertEqual(output_hand.vals, [10, 9, 7, 6, 5])
Esempio n. 3
0
 def test_getRoyalFlush(self):
     c = card.cards()
     cards = orderedCards.OrderedCards(
         [c._10d, c._jd, c._3d, c._4d, c._ad, c._js, c._kd, c._qd])
     #output_hand = getStraightFlushOrFlush(classifyCardsBySuit(cards))
     output_hand = evalHand(cards)
     self.assertEqual(output_hand.handType, HandType.royal_flush)
     self.assertEqual(output_hand.vals, [14])
Esempio n. 4
0
 def test_getFullHouse(self):
     c = card.cards()
     cards = orderedCards.OrderedCards(
         [c._2h, c._2d, c._2s, c._3h, c._3s, c._4s, c._4c, c._4h])
     #output_hand =  getFullHouseOrThreeOfAKind(classifyCardsByVal(cards))
     output_hand = evalHand(cards)
     self.assertEqual(output_hand.handType, HandType.full_house)
     self.assertEqual(output_hand.vals, [4, 3])
Esempio n. 5
0
 def test_getLowStraight(self):
     c = card.cards()
     cards = orderedCards.OrderedCards(
         [c._5h, c._2d, c._3s, c._4h, c._as, c._js, c._8c, c._7c])
     #output_hand = getStraight(classifyCardsByVal(cards))
     output_hand = evalHand(cards)
     self.assertEqual(output_hand.handType, HandType.straight)
     self.assertEqual(output_hand.vals, [5])
Esempio n. 6
0
 def test_getPair(self):
     c = card.cards()
     cards = orderedCards.OrderedCards(
         [c._5h, c._2d, c._3s, c._3h, c._6s, c._js, c._8c, c._7c])
     #output_hand = getTwoPairOrPair(classifyCardsByVal(cards))
     output_hand = evalHand(cards)
     self.assertEqual(output_hand.handType, HandType.pair)
     self.assertEqual(output_hand.vals, [3, 11, 8, 7])
Esempio n. 7
0
 def test_getFourOfAKind(self):
     c = card.cards()
     cards = orderedCards.OrderedCards(
         [c._2h, c._2d, c._2s, c._3h, c._6s, c._js, c._8c, c._2c])
     #output_hand =  getFourOfAKind(classifyCardsByVal(cards))
     output_hand = evalHand(cards)
     self.assertEqual(output_hand.handType, HandType.four_of_a_kind)
     self.assertEqual(output_hand.vals, [2, 11])
Esempio n. 8
0
 def test_getThreeOfAKind(self):
     c = card.cards()
     cards = orderedCards.OrderedCards(
         [c._2h, c._2d, c._2s, c._3h, c._6s, c._js, c._8c, c._ah])
     #output_hand =  getFullHouseOrThreeOfAKind(classifyCardsByVal(cards))
     output_hand = evalHand(cards)
     self.assertEqual(output_hand.handType, HandType.three_of_a_kind)
     self.assertEqual(output_hand.vals, [2, 14, 11])