예제 #1
0
파일: test-Hand.py 프로젝트: von/pyPoker
 def test_too_many_cards(self):
     """Test adding too many cards to a hand."""
     hand = Hand.fromString("AC 2C 3C 4C 5C")
     self.assertEquals(len(hand), 5)
     with self.assertRaises(TooManyCardsException):
         hand.append(Card.fromString("6C"))
     self.assertEquals(len(hand), 5)
예제 #2
0
 def testAceLowHighNonAce(self):
     """Test making sure makeAcesLow() and makeAcesHigh() have no effect on non-ace"""
     c = Card.fromString("9D")
     self.assertEquals(c.rank, Rank.NINE)
     c.makeAcesLow()
     self.assertEquals(c.rank, Rank.NINE)
     c.makeAcesHigh()
     self.assertEquals(c.rank, Rank.NINE)
예제 #3
0
 def testAceLowHigh(self):
     """Test making Aces high and low."""
     c = Card.fromString("AC")
     self.assertEquals(c.rank, Rank.ACE)
     c.makeAcesLow()
     self.assertEquals(c.rank, Rank.ACE_LOW)
     c.makeAcesHigh()
     self.assertEquals(c.rank, Rank.ACE)