示例#1
0
 def test_straight_flush_to_straight_flush_comparison(self):
     player = Player("player", ManualActionCollector())
     player2 = Player("Player2", ManualActionCollector())
     suit = Suit.DIAMONDS
     suit1 = Suit.CLUBS
     hand1 = [
         Card(Number.THREE, suit1),
         Card(Number.FOUR, suit1),
         Card(Number.FIVE, suit1),
         Card(Number.SIX, suit1),
         Card(Number.SEVEN, suit1)
     ]
     hand2 = [
         Card(Number.TWO, suit),
         Card(Number.THREE, suit),
         Card(Number.FOUR, suit),
         Card(Number.FIVE, suit),
         Card(Number.SIX, suit)
     ]
     round_result = RoundResult(
         [HandResult(hand1, player),
          HandResult(hand2, player2)])
     winning_hand_result = round_result.find_winning_hands()[0]
     winning_hand = winning_hand_result.cards
     self.assertTrue(set(hand1).issubset(winning_hand))
     self.assertEqual(player, winning_hand_result.player,
                      "Wrong Winning Player")
示例#2
0
 def test_pair_two_pair_comparison(self):
     player = Player("player", ManualActionCollector())
     player2 = Player("Player2", ManualActionCollector())
     suit = Suit.DIAMONDS
     suit1 = Suit.CLUBS
     hand1 = [
         Card(Number.TWO, suit),
         Card(Number.TWO, suit1),
         Card(Number.THREE, suit),
         Card(Number.THREE, suit1),
         Card(Number.FOUR, suit1)
     ]
     hand2 = [
         Card(Number.ACE, suit),
         Card(Number.ACE, suit1),
         Card(Number.KING, Suit.CLUBS),
         Card(Number.QUEEN, suit),
         Card(Number.JACK, suit1)
     ]
     round_result = RoundResult(
         [HandResult(hand1, player),
          HandResult(hand2, player2)])
     winning_hand = round_result.find_winning_hands()[0].cards
     self.assertTrue(set(hand1).issubset(winning_hand))
示例#3
0
 def test_quads_to_quads_comparison(self):
     player = Player("player", ManualActionCollector())
     player2 = Player("Player2", ManualActionCollector())
     suit = Suit.DIAMONDS
     suit1 = Suit.CLUBS
     hand1 = [
         Card(Number.THREE, suit1),
         Card(Number.THREE, Suit.HEARTS),
         Card(Number.THREE, suit),
         Card(Number.THREE, Suit.SPADES),
         Card(Number.KING, suit1)
     ]
     hand2 = [
         Card(Number.TWO, suit1),
         Card(Number.TWO, Suit.HEARTS),
         Card(Number.TWO, suit),
         Card(Number.TWO, Suit.SPADES),
         Card(Number.KING, suit)
     ]
     round_result = RoundResult(
         [HandResult(hand1, player),
          HandResult(hand2, player2)])
     winning_hand = round_result.find_winning_hands()[0].cards
     self.assertTrue(set(hand1).issubset(winning_hand))
示例#4
0
 def test_straight_to_flush_comparison(self):
     player = Player("player", ManualActionCollector())
     player2 = Player("Player2", ManualActionCollector())
     suit = Suit.DIAMONDS
     suit1 = Suit.CLUBS
     hand1 = [
         Card(Number.TWO, suit),
         Card(Number.NINE, suit),
         Card(Number.FOUR, suit),
         Card(Number.FIVE, suit),
         Card(Number.SIX, suit)
     ]
     hand2 = [
         Card(Number.ACE, Suit.SPADES),
         Card(Number.KING, suit1),
         Card(Number.QUEEN, Suit.SPADES),
         Card(Number.JACK, Suit.HEARTS),
         Card(Number.TEN, suit1)
     ]
     round_result = RoundResult(
         [HandResult(hand1, player),
          HandResult(hand2, player2)])
     winning_hand = round_result.find_winning_hands()[0].cards
     self.assertTrue(set(hand1).issubset(winning_hand))