def testAreAllMazeRowsEqualLengthBottomRowHasExtraFileShouldBeFalse(self): maze = Maze('mazes/linear_maze.txt', QueueFrontier()) maze._maze = [] maze._maze.append(['#', '#', '#']) maze._maze.append(['#', 'B', '#']) maze._maze.append(['#', ' ', '#']) maze._maze.append(['#', 'A', '#']) maze._maze.append(['#', '#', '#', '#']) self.assertFalse(maze._are_all_maze_rows_equal_length())
def testAreAllMazeRowsEqualLengthAllAreEqualLengthShouldBeTrue(self): maze = Maze('mazes/linear_maze.txt', QueueFrontier()) maze._maze = [] maze._maze.append(['#', '#', '#']) maze._maze.append(['#', 'B', '#']) maze._maze.append(['#', ' ', '#']) maze._maze.append(['#', 'A', '#']) maze._maze.append(['#', '#', '#']) self.assertTrue(maze._are_all_maze_rows_equal_length())
def testDoesMazeBottomWallHaveGapsFirstTileIsGapShouldBeTrue(self): maze = Maze('mazes/linear_maze.txt', QueueFrontier()) maze._maze = [] maze._maze.append(['#', '#', '#']) maze._maze.append(['#', 'B', '#']) maze._maze.append(['#', ' ', '#']) maze._maze.append(['#', 'A', '#']) maze._maze.append([' ', '#', '#']) self.assertTrue(maze._does_maze_bottom_wall_have_gaps())
def testDoesBottomWallHaveGapsNoGapsShouldBeFalse(self): maze = Maze('mazes/linear_maze.txt', QueueFrontier()) maze._maze = [] maze._maze.append(['#', '#', '#']) maze._maze.append(['#', 'B', '#']) maze._maze.append(['#', ' ', '#']) maze._maze.append(['#', 'A', '#']) maze._maze.append(['#', '#', '#']) self.assertFalse(maze._does_maze_bottom_wall_have_gaps())
def testDoesMazeTopWallHaveGapsMiddleTileIsGapShouldBeTrue(self): maze = Maze('mazes/linear_maze.txt', QueueFrontier()) maze._maze = [] maze._maze.append(['#', ' ', '#']) maze._maze.append(['#', 'B', '#']) maze._maze.append(['#', ' ', '#']) maze._maze.append(['#', 'A', '#']) maze._maze.append(['#', '#', '#']) self.assertTrue(maze._does_maze_top_wall_have_gaps())
def testGetWidthFromOneByOneShouldBeOne(self): maze = Maze('mazes/linear_maze.txt', QueueFrontier()) maze._maze = [['#']] self.assertEqual(1, maze._get_width())
def testGetWidthFirstRowEmptyShouldBeZero(self): maze = Maze('mazes/linear_maze.txt', QueueFrontier()) maze._maze = [] self.assertEqual(0, maze._get_width())
def testGetWidthEmptyMazeShouldBeZero(self): maze = Maze('mazes/linear_maze.txt', QueueFrontier()) maze._maze = None self.assertEqual(0, maze._get_width())
def testGetHeightMazeIsEmptyList(self): maze = Maze('mazes/linear_maze.txt', QueueFrontier()) maze._maze = [] self.assertEqual(0, maze._get_height())
def testGetHeightMazeIsNone(self): maze = Maze('mazes/linear_maze.txt', QueueFrontier()) maze._maze = None self.assertEqual(0, maze._get_height())
def testIsMazeCompleteRectangleMazeIsSingleSpaceShouldBeFalse(self): maze = Maze('mazes/linear_maze.txt', QueueFrontier()) maze._maze = [[' ']] self.assertFalse(maze._is_maze_complete_rectangle())
def testIsMazeCompleteRectangleMazeIsSingleHashShouldBeTrue(self): maze = Maze('mazes/linear_maze.txt', QueueFrontier()) maze._maze = [['#']] self.assertTrue(maze._is_maze_complete_rectangle())