Skip to content

Commit

Permalink
feat: add test for creating block data with default states
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-vincent committed Sep 2, 2024
1 parent 43df9b8 commit 715c2f9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/endstone_test/tests/test_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ def server(plugin: Plugin) -> Server:
return plugin.server


def test_create_block_data(server: Server) -> None:
def test_create_block_data_default_block_states(server: Server) -> None:
block_data = server.create_block_data("minecraft:standing_sign")
assert block_data.type == "minecraft:standing_sign"
assert "ground_sign_direction" in block_data.block_states
assert block_data.block_states["ground_sign_direction"] == 0
assert "block_light_level" not in block_data.block_states


def test_create_block_data_custom_block_states(server: Server) -> None:
block_data = server.create_block_data("minecraft:standing_sign", {"ground_sign_direction": 8})
assert block_data.type == "minecraft:standing_sign"
assert "ground_sign_direction" in block_data.block_states
Expand Down

0 comments on commit 715c2f9

Please sign in to comment.