Exemple #1
0
def test_render_players_with_freeze(pygame):
    game = Game()
    game.alive_players = [
        Player(0, 32, 32),
    ]
    game.alive_players[0].set_freeze()
    drawer = Drawer(game)
    drawer._blit = Mock(spec=drawer._blit)

    drawer._render_players()

    assert drawer._blit.call_args_list == [
        call('IMG_PLAYER_1_1', game.alive_players[0]),
        call('FREEZE', game.alive_players[0]),
    ]
Exemple #2
0
def test_render_players(pygame):
    game = Game()
    game.alive_players = [
        Player(0, 32, 32),
        Player(1, 64, 32),
    ]
    drawer = Drawer(game)
    drawer._blit = Mock(spec=drawer._blit)

    drawer._render_players()

    assert drawer._blit.call_args_list == [
        call('IMG_PLAYER_1_1', game.alive_players[0]),
        call('IMG_PLAYER_2_1', game.alive_players[1]),
    ]