def test_moreThan1_dealer_raises_ValueErr(self): player0 = Player(role="Dealer") player1 = Player(role="Dealer") player2 = Player(role="Player") players = [player0, player1, player2] shoe = Shoe(1) with pytest.raises(ValueError): Game(players, shoe)
def shoe(): return Shoe()
def test_generates_card(self, decks): shoe = Shoe(decks=decks) assert type(shoe.cards) is list assert len(shoe.cards) == 52 * decks
def test_deal_returns_a_card(self): shoe = Shoe() assert type(shoe.deal()) is Card
def test_card_less_after_deal(self): shoe = Shoe() cards_len = len(shoe.cards) - 1 shoe.deal() assert cards_len == len(shoe.cards)
def test_deal_deals_a_card(self): shoe = Shoe() cards = shoe.cards card = shoe.deal() assert type(card) is Card
def test_shuffles_card(self): shoe = Shoe() unshuffled = shoe.cards.copy() shoe.shuffle() shuffled = shoe.cards assert unshuffled != shuffled