mirror of
https://github.com/maoakeEnterprise/amazing.git
synced 2026-04-28 16:04:35 +02:00
need to fix my infinite while so i make a checkpoint if i need to restore it
This commit is contained in:
+8
-6
@@ -1,5 +1,6 @@
|
||||
from amaz_lib.MazeGenerator import DepthFirstSearch
|
||||
from amaz_lib.Cell import Cell
|
||||
import numpy as np
|
||||
|
||||
|
||||
class TestDepth:
|
||||
@@ -12,7 +13,7 @@ class TestDepth:
|
||||
|
||||
def test_rand_cells(self) -> None:
|
||||
w_h = (10, 10)
|
||||
lst = DepthFirstSearch.add_cell_visited((0, 0))
|
||||
lst = DepthFirstSearch.add_cell_visited((0, 0), set())
|
||||
rand_cells = DepthFirstSearch.random_cells(lst, (0, 1), w_h)
|
||||
assert len(rand_cells) == 2
|
||||
|
||||
@@ -24,10 +25,11 @@ class TestDepth:
|
||||
def test_reverse_path(self) -> None:
|
||||
assert DepthFirstSearch.reverse_path("N") == "S"
|
||||
|
||||
def test_last(self) -> None:
|
||||
lst = [(0, 0), (1, 1)]
|
||||
assert DepthFirstSearch.last(lst) == (1, 1)
|
||||
|
||||
def test_BOS(self) -> None:
|
||||
path = [(0, 0), (0, 2), (1, 1)]
|
||||
path = {(0, 0), (0, 2), (1, 1)}
|
||||
assert len(DepthFirstSearch.random_cells(path, (0, 1), (10, 10))) == 0
|
||||
|
||||
def test_generator(self):
|
||||
maze = np.array([])
|
||||
maze = DepthFirstSearch.generator(10, 10)
|
||||
assert maze.shape == (10, 10)
|
||||
|
||||
Reference in New Issue
Block a user