-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow inspection of artefact's type and types via the world map (…
…#1494) * allow inspection of artefact's type and types via the world map * feat: allow inspection of artefact's type and types via the world map * Merge branch 'moreartefacts' of https://github.com/ocadotechnology/aimmo into moreartefacts * check backpack existence * add test coverage for avatar state * Merge branch 'development' into moreartefacts * Merge branch 'development' into moreartefacts
- Loading branch information
Showing
3 changed files
with
48 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
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
23 changes: 23 additions & 0 deletions
23
aimmo-game-worker/tests/tests_simulation/test_avatar_state.py
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 __future__ import absolute_import | ||
|
||
from unittest import TestCase | ||
|
||
from simulation.location import Location | ||
from simulation.avatar_state import create_avatar_state | ||
|
||
|
||
class TestAvatarState(TestCase): | ||
AVATAR = {"location": {"x": 0, "y": 0}, "backpack": [{"type": "key"}]} | ||
|
||
def test_create_avatar_state(self): | ||
avatar_state = create_avatar_state(self.AVATAR) | ||
avatar_loc = self.AVATAR["location"] | ||
|
||
self.assertEqual( | ||
avatar_state.location, | ||
Location(avatar_loc["x"], avatar_loc["y"]), | ||
) | ||
|
||
self.assertEqual( | ||
avatar_state.backpack[0].type, self.AVATAR["backpack"][0]["type"] | ||
) |