示例#1
0
def test_player_should_have_no_cards_after_removing_only_card(person, turtle):
    card = Card(0, 'RED', 'PLUS')
    player = Player(person, turtle, [card])

    player.remove_card(card)

    assert not player.cards
示例#2
0
def test_player_shouldnt_have_card_after_its_removal(person, turtle):
    card = Card(0, 'RED', 'PLUS')
    cards = [card, Card(1, 'RED', 'MINUS')]
    player = Player(person, turtle, cards)

    player.remove_card(card)

    assert not player.has_card(card)
示例#3
0
def test_remove_card_should_raise_when_player_has_other_card(person, turtle):
    player = Player(person, turtle, [Card(1, 'RED', 'MINUS')])

    with pytest.raises(ValueError):
        player.remove_card(Card(0, 'RED', 'PLUS'))
示例#4
0
 def _update_player_cards_and_stacks(self, player: Player, action: Action):
     self.stacks.put(action.card)
     player.remove_card(action.card)
     new_card = self.stacks.get_new()
     player.add_card(new_card)