Ejemplo n.º 1
0
 def test_create_cards(self):
     """test the create_cards function"""
     ranks = create_ranks(['ship', 'shape', 'shop'])
     suits = create_suits(['x', 'y', 'z'])
     cards = create_cards(ranks, suits)
     for card in cards:
         self.assertEqual(card.__class__, Card)
         self.assertEqual(card, card)
         self.assertEqual(card, 
                          Card(Rank(card.rank.index, card.rank.label), 
                               Suit(card.suit.label)))
     self.assertEqual(len(ranks)*len(suits), len(cards))
     self.assertNotEqual(cards[0], cards[2])
Ejemplo n.º 2
0
def display_multiple(listOfNums):
	card_info = [CARD_DB[num] for num in listOfNums]
	card_string = card.create_cards(card_info)
	print card_string