Exemplo n.º 1
0
    def test(self):
        """Ensures that we can finish a game using maxrounds."""
        decks = [deck.Deck(deck.basepacks)]
        player_list = create_players_helper()
        rounds_to_test = 20
        game = Game(name="Max Rounds Test Game", decks=decks, maxrounds=rounds_to_test, players=player_list)

        better_fox, fox, stallion, derpy_dog, derpy_pony = game.players
        player_list = set(game.players)

        for next_round in range(0, rounds_to_test):
            game.round_start()
            winner = random.choice(list(player_list.difference([game.tsar])))
            game.player_play(winner, game.playercards[winner][0 : game.card_black().playcount])
            game.round_end(winner)
        self.assertTrue(game.spent)
Exemplo n.º 2
0
    def test(self):
        """Ensures that we can finish a game using maxap."""
        decks = [deck.Deck(deck.basepacks)]
        player_list = create_players_helper()
        ap_to_test = 40
        game = Game(name="Max AP Test Game", decks=decks, maxap=ap_to_test, players=player_list)

        better_fox, fox, stallion, derpy_dog, derpy_pony = game.players

        for next_round in range(0, ap_to_test + 1 + int(ceil(ap_to_test / 5))):
            game.round_start()
            if (next_round + 1) % 5 == 0:
                game.player_play(derpy_dog, game.playercards[derpy_dog][0 : game.card_black().playcount])
                game.round_end(derpy_dog)
            else:
                game.player_play(better_fox, game.playercards[better_fox][0 : game.card_black().playcount])
                game.round_end(better_fox)

        self.assertTrue(game.spent)