def test_checkSameColourFalse(self): card1 = Poker.Card(figure=10, colour=0) card2 = Poker.Card(figure=5, colour=1) card3 = Poker.Card(figure=12, colour=3) card4 = Poker.Card(figure=5, colour=0) card5 = Poker.Card(figure=5, colour=1) cardList = [card1, card2, card3, card4, card5] pointCounter = Poker.pointCounter() self.assertFalse(pointCounter.checkSameColour(cardList))
def test_findTwoPairFalse(self): card1 = Poker.Card(figure=10, colour=0) card2 = Poker.Card(figure=5, colour=1) card3 = Poker.Card(figure=3, colour=3) card4 = Poker.Card(figure=10, colour=0) card5 = Poker.Card(figure=13, colour=1) cardList = [card1, card2, card3, card4, card5] pointCounter = Poker.pointCounter() self.assertFalse(pointCounter.findTwoPair(cardList))
def test_checkStraightTrue(self): card1 = Poker.Card(figure=2, colour=0) card2 = Poker.Card(figure=4, colour=4) card3 = Poker.Card(figure=5, colour=0) card4 = Poker.Card(figure=6, colour=1) card5 = Poker.Card(figure=3, colour=0) cardList = [card1, card2, card3, card4, card5] pointCounter = Poker.pointCounter() self.assertTrue(pointCounter.checkStraight(cardList))
def test_findFullHouse(self): card1 = Poker.Card(figure=10, colour=0) card2 = Poker.Card(figure=5, colour=1) card3 = Poker.Card(figure=5, colour=3) card4 = Poker.Card(figure=10, colour=0) card5 = Poker.Card(figure=5, colour=1) cardList = [card1, card2, card3, card4, card5] pointCounter = Poker.pointCounter() self.assertTrue(pointCounter.findFullHouse(cardList))
def test_findSameFiguresFalse(self): card1 = Poker.Card(figure=10, colour=0) card2 = Poker.Card(figure=5, colour=1) card3 = Poker.Card(figure=12, colour=3) card4 = Poker.Card(figure=2, colour=0) card5 = Poker.Card(figure=1, colour=1) cardList = [card1, card2, card3, card4, card5] pointCounter = Poker.pointCounter() self.assertFalse(pointCounter.findSameFigures(cardList, 3))
def test_HighCardCombination(self): card1 = Poker.Card(figure=14, colour=0) card2 = Poker.Card(figure=2, colour=1) card3 = Poker.Card(figure=11, colour=3) card4 = Poker.Card(figure=9, colour=2) card5 = Poker.Card(figure=13, colour=1) mock_hand = Mock() mock_hand.cards = [card1, card2] tableCard = [card3, card4, card5] pointCounter = Poker.pointCounter() best, bestResultList = pointCounter.countBestResult( hand=mock_hand, tableCards=tableCard) self.assertEqual(best, Poker.GetResultName('High card'))
def test_FlushCombination(self): card1 = Poker.Card(figure=7, colour=0) card2 = Poker.Card(figure=10, colour=1) card3 = Poker.Card(figure=12, colour=1) card4 = Poker.Card(figure=5, colour=1) card5 = Poker.Card(figure=13, colour=1) mock_hand = Mock() mock_hand.cards = [card1, card2] tableCard = [card3, card4, card5] pointCounter = Poker.pointCounter() best, bestResultList = pointCounter.countBestResult( hand=mock_hand, tableCards=tableCard) self.assertEqual(best, Poker.GetResultName('Flush'))
def test_generateCombinationFromTableLength(self): card1 = Poker.Card(figure=2, colour=0) card2 = Poker.Card(figure=3, colour=1) card3 = Poker.Card(figure=4, colour=3) card4 = Poker.Card(figure=5, colour=3) card5 = Poker.Card(figure=6, colour=1) card6 = Poker.Card(figure=7, colour=2) card7 = Poker.Card(figure=12, colour=1) mock_hand = Mock() mock_hand.cards = [card1, card2] tableCards = [card3, card4, card5, card6, card7] pointCounter = Poker.pointCounter() self.assertEqual( 10, len( pointCounter.generateCombinationFromTable( hand=mock_hand, tableCards=tableCards)))
def test_card_printer2(self): card = Poker.Card(0, 3) self.assertEqual('Card colour is SPADES and figure is 3', str(card))
def test_card_printer(self): card = Poker.Card(1, 12) self.assertEqual('Card colour is HEARTS and figure is QUEEN', str(card))
def test_get_colour_name(self): card = Poker.Card(2, 11) self.assertEqual( 'DIMONDS', card.geColourName(), )
def test_get_figure_name(self): card = Poker.Card(0, 11) self.assertEqual('JACK', card.getFigureName())