Skip to content

Commit

Permalink
test: add tests for Inventory.get_item and Inventory.set_item
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-vincent committed Oct 28, 2024
1 parent 4a94686 commit e9d40c2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "hatchling.build"
[project]
name = "endstone-test"
version = "0.0.1"
dependencies = ["babel", "pytest"]
dependencies = ["babel", "pytest==8.3.2"]
authors = [
{ name = "Vincent Wu", email = "[email protected]" },
]
Expand Down
4 changes: 4 additions & 0 deletions src/endstone_test/tests/on_player_join/test_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from babel import Locale
from endstone import GameMode, Player, Server
from endstone.plugin import Plugin
from endstone.inventory import ItemStack


@pytest.fixture
Expand All @@ -19,6 +20,9 @@ def test_player_inventory(player: Player):
assert player.inventory.size == 36
assert player.inventory.max_stack_size == 254

player.inventory.set_item(35, ItemStack("minecraft:clock", 1))
assert player.inventory.get_item(35).type == "minecraft:clock"


def test_player_permissions(player: Player, plugin: Plugin):
assert player.has_permission("minecraft.command.me") is True
Expand Down

0 comments on commit e9d40c2

Please sign in to comment.