Skip to content

Commit

Permalink
feat: add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-vincent committed Jun 21, 2024
1 parent 6262362 commit 1c68c40
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/endstone_test/event_listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ def send_welcome_message(player_name: str) -> None:
current_exp_lvl = event.player.exp_level
event.player.give_exp_levels(2)
assert event.player.exp_level == current_exp_lvl + 2
assert 0.0 <= event.player.exp <= 1.0
assert 0.0 <= event.player.exp_progress <= 1.0
event.player.exp_level = current_exp_lvl + 1
assert event.player.exp_level == current_exp_lvl + 1

@event_handler
def on_player_death(self, event: PlayerDeathEvent):
Expand Down
2 changes: 1 addition & 1 deletion src/endstone_test/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,5 @@ def send_debug_message(self):
f"Dimension: {player.location.dimension.name}\n"
f"InWater: {player.is_in_water}, InLava: {player.is_in_lava}\n"
f"OnGround: {player.is_on_ground}, MayFly: {player.allow_flight}, Flying: {player.is_flying}\n"
f"Exp: {player.exp}, Lv: {player.exp_level}"
f"Exp: {player.exp_progress}, Lv: {player.exp_level}, Total: {player.total_exp}"
)

0 comments on commit 1c68c40

Please sign in to comment.