Example #1
0
def test_end_game2(game):
    player = Player("user")
    game.end_game(player)
    player2 = Player("user2")
    game.player_acc = 100
    game.end_game(player2)
    assert game.base.rank == {"user": "******", "user2": "100 PLN"}
def test_add_rank(database):
    if not os.path.exists(database.rank_path):
        player = Player("user")
        database.add_result_to_rank(player, 100)
        database1 = Database()
        exp_rank = {"user": "******"}
        assert database1.rank == exp_rank
    pass
Example #3
0
def test_end_game1(game):
    player = Player("user")
    game.end_game(player)
    assert game.base.rank == {"user": "******"}
Example #4
0
def test_win_million(game):
    player = Player("user")
    game.player_acc = 1000000
    game.end_game(player)
    game2 = Game()
    assert game2.base.rank == {"user": "******"}
Example #5
0
 def setup(self):
     player = Player("user")
     return player
Example #6
0
 def test_create_player(self):
     player = Player.create_player("tm")
     assert isinstance(player, Player)
Example #7
0
 def test_get_player_nick(self, test_input, expected):
     player = Player(test_input)
     assert player.player_nick == expected
 def add_player():
     nick = input("Enter your nick (max 10 chars [a-Z, 0-9]): ")
     return Player.create_player(nick)