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
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)
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'))
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)