Example #1
0
def test_deck_burned_dealed_are_correct_size():
    deck = Deck()
    original_size = len(deck)
    card1 = deck.deal()
    card2 = deck.deal()
    deck.replace(card1)
    deck.replace(card2)
    assert len(deck) == 48
    assert len(deck) + deck.burned_size() + deck.dealed_size() == original_size
Example #2
0
def test_replace_card_remain_at_same_place():
    deck = Deck()
    card1 = deck.deal()
    card2 = deck.deal()
    card3 = deck.deal()
    new_card = deck.replace(card2)
    assert new_card != card2
    assert card1 == deck.dealed[0]
    assert new_card == deck.dealed[1]
    assert card3 == deck.dealed[2]
Example #3
0
def test_replaced_card():
    deck = Deck()
    original_size = len(deck)
    card = deck.deal()
    new_card = deck.replace(card)
    assert len(deck) == original_size - 2
    assert len(deck.dealed) == 1
    assert len(deck.burned) == 1
    assert card != new_card
    assert deck.dealed[0] == new_card
    assert deck.burned[0] == card