Ejemplo n.º 1
0
def test_find_maze(bomb, test_mazes):
    """Test finding mazes."""
    maze = Maze(bomb)
    maze.load_mazes()

    for test_maze in test_mazes:
        maze.set_greens(test_maze['greens'])
        actual = maze.find_maze()
        expected = test_maze['data']
        assert actual == expected
Ejemplo n.º 2
0
def test_load_mazes(bomb, test_mazes):
    """Test loading mazes from a file."""
    # TODO: this could probably be more thorough.
    maze = Maze(bomb)
    popped_test_mazes = []
    for test_maze in test_mazes:
        test_maze.pop('start')
        test_maze.pop('goal')
        test_maze.pop('path')
        test_maze.pop('instructions')
        popped_test_mazes.append(test_maze)

    actual = maze.load_mazes()
    expected = popped_test_mazes

    assert actual == expected