def test_reveal_card_with_no_option(self, game: Game): game.event_cards = ["spanish-armada"] player = game.turn self._reveal_event_card_action(player, 0) assert (game.last_action.action_type == Action.ActionType.REVEAL_EVENT_CARD) assert game.turn != player
def test_reveal_albatross_card(self, game: Game): game.event_cards = ["albatross"] player = game.turn self._reveal_event_card_action(player, 0) game_status = self._get_my_game(player).json() assert (game_status["gameStatus"]["playerGameInfo"]["availableActions"] == [Action.ActionType.KEEP_EVENT_CARD])
def test_use_event_card_after_reveal(self, game: Game): event_card_slug = "letter-of-marque" game.event_cards = ["letter-of-marque"] player = game.turn game.players_position[player] = Positions.JR_B self._reveal_event_card_action(player, 0) self.use_event_card_action(player, event_card_slug, 0) assert game.players_position[player] in Positions.jr_positions()
def test_reveal_spanish_armada_card(self, game: Game): game.event_cards = ["spanish-armada"] player = game.turn self._reveal_event_card_action(player, 0) game_response = self._get_my_game(player).json() assert game_response["gameStatus"]["winner"]["winnerTeam"] == "dutch" assert (len( game_response["gameStatus"]["winner"]["playersTeams"]) == len( game.players))
def test_reveal_eight_bells(self, game: Game): player = game.turn position = game.get_position(player) # since it's random we test until we get the result! while game.get_position(player) == position: player = game.turn position = game.get_position(player) game.event_cards = ["eight-bells"] self._reveal_event_card_action(player, 0) assert game.get_position(player) != position
def test_reveal_fountain_of_youth_dodge_maroon(self, game: Game): player = game.turn game.event_cards = ["fountain-of-youth"] self._reveal_event_card_action(player, 0) self._keep_event_card_action(player) response = self._get_my_game(player).json() assert (response["gameStatus"]["playerGameInfo"]["eventCards"][0] ["eventCard"]["slug"] == "fountain-of-youth") player_position = game.get_position(player) game.maroon_player(player) assert game.get_position(player) == player_position
def test_keep_event_card(self, game: Game): game.event_cards = ["letter-of-marque"] player = game.turn self._reveal_event_card_action(player, 0) assert player == game.turn self._keep_event_card_action(player) r = self._get_my_game(player).json() assert len(r["gameStatus"]["playerGameInfo"]["eventCards"]) > 0 assert ("canUse" in r["gameStatus"]["playerGameInfo"]["eventCards"][0] and "eventCard" in r["gameStatus"]["playerGameInfo"]["eventCards"][0]) assert player != game.turn
def test_reveal_pistol_card(self, game: Game): game.event_cards = ["pistol"] player = game.turn self._reveal_event_card_action(player, 0) game_response = self._get_my_game(player).json() assert (game_response["gameStatus"]["lastAction"]["actionType"] == "reveal one event card") assert len(game_response["gameStatus"]["lastAction"]["actionData"] ["eventCardOptions"]) == 3 self.use_event_card_action(player, "pistol", 0) assert list( game.players_position.values())[1] in Positions.tr_positions()
def test_two_players_with_albatross(self, game: Game): game.event_cards = ["albatross", "albatross"] player1 = game.turn self._reveal_event_card_action(player1, 0) self._keep_event_card_action(player1) while game.get_position(game.turn) not in Positions.jr_positions(): game.next_turn() player2 = game.turn self._reveal_event_card_action(player2, 0) self._keep_event_card_action(player2) response = self._get_my_game(player2).json() assert (response["gameStatus"]["playersPosition"][player1] in Positions.tr_positions()) assert (response["gameStatus"]["playersPosition"][player2] in Positions.tr_positions())
def test_reveal_card_with_options(self, game: Game): game.event_cards = ["letter-of-marque"] player = game.turn self._reveal_event_card_action(player, 0) assert player == game.turn assert (game.last_action.action_data.can_keep == True)