예제 #1
0
	def test_flush(self):
		print "test_flush"
		openCards = []
		openCards.append(self.deck.getSpecificCard(3,3))
		openCards.append(self.deck.getSpecificCard(7,3))
		openCards.append(self.deck.getSpecificCard(10,2)) 
		openCards.append(self.deck.getSpecificCard(8,3)) 
		openCards.append(self.deck.getSpecificCard(13,3))
		self.hand.append(self.deck.getSpecificCard(4,2))
		self.hand.append(self.deck.getSpecificCard(10,3))
		self.opponentsHand.append(self.deck.getSpecificCard(3,2))
		self.opponentsHand.append(self.deck.getSpecificCard(7,0))
		self.assertEqual(evaluator.determineWinningHand(self.hand,self.opponentsHand,openCards),1)
		self.assertTrue(evaluator.isFlush(openCards+self.hand))
예제 #2
0
	def test_straightFlush(self):
		print "test_straightFlush"
		# straight flush vs. straight flush
		openCards = []
		openCards.append(self.deck.getSpecificCard(11,1))
		openCards.append(self.deck.getSpecificCard(12,1))
		openCards.append(self.deck.getSpecificCard(10,1))
		openCards.append(self.deck.getSpecificCard(4,2)) # irrelevant card
		openCards.append(self.deck.getSpecificCard(3,2)) # irrelevant card
		self.hand.append(self.deck.getSpecificCard(14,1))
		self.hand.append(self.deck.getSpecificCard(13,1))
		self.opponentsHand.append(self.deck.getSpecificCard(9,2))
		self.opponentsHand.append(self.deck.getSpecificCard(8,2))
		self.assertTrue(evaluator.isFlush(openCards+self.hand))
		self.assertTrue(evaluator.isStraightFlush(openCards+self.hand))
		self.assertEqual(evaluator.determineWinningHand(self.hand,self.opponentsHand,openCards),1)