Skip to content

Commit

Permalink
Linting and test fixes!
Browse files Browse the repository at this point in the history
  • Loading branch information
apockill committed Dec 25, 2023
1 parent b07c372 commit d81582a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions crawlai/game_scripts/world.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,4 @@ def step(grid: Grid, pool: ThreadPool) -> None:

def close(self) -> None:
self.pool.terminate()
self.pool.join()
2 changes: 1 addition & 1 deletion crawlai/items/critter/base_critter.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from crawlai.position import Position
from crawlai.turn import Turn

_critter_resource = ResourceLoader.load("res://Game/Critter/Critter.tscn")
_critter_resource = ResourceLoader.load("assets/critter.png")


class BaseCritter(GridItem):
Expand Down
3 changes: 1 addition & 2 deletions crawlai/items/food.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
from crawlai.grid_item import GridItem
from crawlai.math_utils import clamp


_food_resource = ResourceLoader.load("res://Game/Food/Food.tscn")
_food_resource = ResourceLoader.load("assets/food.png")


class Food(GridItem):
Expand Down
6 changes: 3 additions & 3 deletions tests/godot_mock/bindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ def get_instance_id(self):
return self._instance_id

def add_child(self, node):
assert isinstance(node, Node)
assert isinstance(node, Node), f"Expected {Node}, got {type(node)}"

def set_position(self, vector2):
assert isinstance(vector2, Vector2)
assert isinstance(vector2, Vector2), f"Expected {Vector2}, got {type(vector2)}"
assert vector2
self._position = vector2

Expand All @@ -47,7 +47,7 @@ class ResourceLoader:
@staticmethod
def load(resource_path: str):
"""Verify the resource path exists"""
resource_path = resource_path.replace("res://", "")
resource_path = Path(resource_path).absolute().resolve(strict=True)
assert Path(resource_path).is_file()

class Unloaded:
Expand Down

0 comments on commit d81582a

Please sign in to comment.