コード例 #1
0
    def test_can_create_standard_52_cards(self):
        cards = Card.create_standard_52_cards()
        self.assertEqual(len(cards), 52)

        self.assertEqual(cards[0], Card(rank="2", suit="Hearts"))

        self.assertEqual(cards[-1], Card(rank="Ace", suit="Diamonds"))
コード例 #2
0
from Poker.Card import Card
from Poker.Deck import Deck

deck = Deck()
cards = Card.create_standard_52_cards()
deck.add_cards(cards)

#mala practica: doble punto de métodos.
#deck.cards.extend(cards)
print(cards)