Пример #1
0
    def populate(self):
        all_suits = Suit()
        all_values = CardValue()
        all_cards = []

        for value in all_values.symbols:
            for suit in all_suits.suits:
                new_card = Card(suit, value)
                new_card.add_value()
                all_cards.append(new_card)

        self.cards = all_cards
Пример #2
0
class TestCard(unittest.TestCase):
    def setUp(self):
        self.card = Card("Spades", "Ten")

    def test_has_suit(self):
        self.assertEqual("Spades", self.card.suit)

    def test_has_symbol(self):
        self.assertEqual("Ten", self.card.symbol)

    def test_can_add_value(self):
        self.card.add_value()
        self.assertEqual(10, self.card.value)