예제 #1
0
 def test_no_lay_down(self):
     ranks = ["2", "3", "4", "5"]
     suits = ["spades"]
     deck = [(rank, suit) for rank in ranks for suit in suits]
     hand = {}
     for i in range(len(ranks)):
         drawCardFixed("Matt", deck, hand)
     for rank in ranks:
         self.assertTrue(rank in hand)  # no ranks should be laid down
예제 #2
0
 def test_lay_down(self):
     ranks = ["2"]
     suits = ["spades", "hearts", "diamonds", "clubs"]
     deck = [(rank, suit) for rank in ranks for suit in suits]
     hand = {}
     for i in range(1, 4):
         drawCardFixed("Matt", deck, hand)
         self.assertTrue("2" in hand and len(hand["2"]) == i)
     drawCardFixed("Matt", deck, hand)
     self.assertFalse("2" in hand)  # 2s should be laid down