Skip to content

Commit

Permalink
test: testing the choke sides are included in choke points
Browse files Browse the repository at this point in the history
  • Loading branch information
eladyaniv01 committed Dec 13, 2020
1 parent 8f5b0c9 commit e3b0b26
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/test_pathihng.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def test_climber_grid() -> None:
assert (path is None)
grid = map_data.get_climber_grid()
path = map_data.pathfind(start=start, goal=goal, grid=grid)
assert (path is None)
assert (path is not None), f"path {path}"


def test_minerals_walls() -> None:
Expand Down
4 changes: 3 additions & 1 deletion tests/test_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def test_polygon(self, map_data: MapData) -> None:
assert (polygon.is_inside_point(point) is True)

# https://github.com/BurnySc2/python-sc2/issues/62
assert (point is not None)
assert isinstance(point, Point2)
assert (type(point[0] == int))

for point in polygon.corner_points:
Expand All @@ -108,6 +108,8 @@ def test_chokes(self, map_data: MapData) -> None:
assert (choke in map_data.where_all(p)), \
logger.error(f"<Map : {map_data}, Choke : {choke},"
f" where : {map_data.where(choke.center)} point : {choke.center}>")
assert (choke.side_a in choke.points), f"Choke {choke}, side a {choke.side_a} is not in choke points"
assert (choke.side_b in choke.points), f"Choke {choke}, side b {choke.side_b} is not in choke points"

def test_vision_blockers(self, map_data: MapData) -> None:
all_chokes = map_data.map_chokes
Expand Down

0 comments on commit e3b0b26

Please sign in to comment.