generated from EndstoneMC/python-example-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add tests for overloaded Dimension.get_block_at function
- Loading branch information
1 parent
ae552ff
commit dfc9be7
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from babel import Locale | ||
from endstone import Player, Server, GameMode | ||
from endstone.plugin import Plugin | ||
import pytest | ||
|
||
|
||
@pytest.fixture | ||
def server(player: Player) -> Server: | ||
return player.server | ||
|
||
|
||
def test_get_block_at_xyz(player: Player) -> None: | ||
location = player.location | ||
block = player.dimension.get_block_at(location.block_x, -64, location.block_z) | ||
assert block.type == "minecraft:bedrock" | ||
block = player.dimension.get_block_at(location.block_x, 320, location.block_z) | ||
assert block.type == "minecraft:air" | ||
|
||
|
||
def test_get_block_at_location(player: Player) -> None: | ||
location = player.location | ||
block = player.dimension.get_block_at(location) | ||
assert block.data.type == block.type |