Skip to content

Commit

Permalink
refactor: move player command tests into a separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-vincent committed Oct 7, 2024
1 parent ec26121 commit 21f641f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
14 changes: 14 additions & 0 deletions src/endstone_test/tests/on_player_join/test_command.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

from endstone import Player, Server
import pytest


@pytest.fixture
def server(player: Player) -> Server:
return player.server

def test_run_command(player: Player):
assert player.perform_command("test sender")

def test_run_command_as_server(player: Player, server: Server):
server.dispatch_command(server.command_sender, f'execute as "{player.name}" run scriptevent endstone:test Hello World!')
4 changes: 0 additions & 4 deletions src/endstone_test/tests/on_player_join/test_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,3 @@ def test_player_scoreboard(player: Player, server: Server):

player.scoreboard = server.scoreboard
assert player.scoreboard is server.scoreboard


def test_run_command(player: Player):
assert player.perform_command("test sender")

0 comments on commit 21f641f

Please sign in to comment.