def test_hand_add_all_1_card_as_list(): """ Add 1 card as list to non-empty Hand""" hand = Hand() card1 = Card('H', '5') card2 = Card('S', 'J') hand.add_card(card1) hand.add_card(card2) hand.add_all([Card('C', '2')]) assert len(hand.cards) == 3
def test_hand_add_all_to_non_empty(): """ Add list of cards to non-empty Hand""" hand = Hand() card1 = Card('H', '5') card2 = Card('S', 'J') hand.add_card(card1) hand.add_card(card2) hand_cards_len_before_add_all = len(hand.cards) assert hand_cards_len_before_add_all == 2 cards = [Card('D', '5'), Card('C', '10'), Card('H', 'A'), Card('S', 'K')] hand.add_all(cards) hand_cards_len_after_add_all = len(hand.cards) assert hand_cards_len_after_add_all == hand_cards_len_before_add_all + len( cards)
def test_hand_add_all_to_empty(): """ Add list of cards to empty Hand""" cards = [Card('D', '5'), Card('C', '10'), Card('H', 'A'), Card('S', 'K')] hand = Hand() hand.add_all(cards) assert len(hand.cards) == len(cards)