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

    player.add_card(card)

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

    player.add_card(card)

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

    player.add_card(card)

    assert player.has_card(card)
示例#4
0
def test_new_card_should_add_card_for_player_with_two_cards(person, turtle):
    cards = [Card(0, 'RED', 'PLUS'), Card(1, 'GREEN', 'MINUS')]
    player = Player(person, turtle, cards)
    card = Card(2, 'RAINBOW', 'ARROW')

    player.add_card(card)

    assert player.cards[0] == card
示例#5
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)