From b0ca1d4edfa7835107f0b4f345dce0b92778a2d0 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Sun, 10 Jan 2021 23:05:49 +0100 Subject: [PATCH] Cover everytime the map generation test --- squirrelbattle/tests/mapgeneration_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/squirrelbattle/tests/mapgeneration_test.py b/squirrelbattle/tests/mapgeneration_test.py index 3879f8f..5fa19fd 100644 --- a/squirrelbattle/tests/mapgeneration_test.py +++ b/squirrelbattle/tests/mapgeneration_test.py @@ -26,8 +26,8 @@ class TestBroguelike(unittest.TestCase): def is_connex(self, grid: List[List[Tile]]) -> bool: h, w = len(grid), len(grid[0]) - y, x = randint(0, h - 1), randint(0, w - 1) - while not (grid[y][x].can_walk() or grid[y][x] == Tile.DOOR): + y, x = -1, -1 + while not grid[y][x].can_walk(): y, x = randint(0, h - 1), randint(0, w - 1) queue = Map.neighbourhood(grid, y, x) while queue: