Exemplo n.º 1
0
 def __post_init__(self):
     """ Generate actual list of Card instances from card_string """
     self.card_list = []
     for suit_holding in self.card_string.split():
         suit = Suit[suit_holding[0]]
         for rank in suit_holding[2:]:
             card = Card(suit, Rank[rank])
             self.card_list.append(card)
     shuffle(self.card_list)
Exemplo n.º 2
0
def test_wrong_cards():
    with pytest.raises(ValueError):
        BridgeHand([Card(Suit.S, Rank.A)] + [None] * 12)