コード例 #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
ファイル: test-Cards.py プロジェクト: thecowboy/pyPoker
 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
ファイル: test-Cards.py プロジェクト: thecowboy/pyPoker
 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)