Exemple #1
0
 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())
Exemple #2
0
 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())
Exemple #3
0
 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())
Exemple #4
0
 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())
Exemple #5
0
 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())
Exemple #6
0
 def testGetWidthFromOneByOneShouldBeOne(self):
     maze = Maze('mazes/linear_maze.txt', QueueFrontier())
     maze._maze = [['#']]
     self.assertEqual(1, maze._get_width())
Exemple #7
0
 def testGetWidthFirstRowEmptyShouldBeZero(self):
     maze = Maze('mazes/linear_maze.txt', QueueFrontier())
     maze._maze = []
     self.assertEqual(0, maze._get_width())
Exemple #8
0
 def testGetWidthEmptyMazeShouldBeZero(self):
     maze = Maze('mazes/linear_maze.txt', QueueFrontier())
     maze._maze = None
     self.assertEqual(0, maze._get_width())
Exemple #9
0
 def testGetHeightMazeIsEmptyList(self):
     maze = Maze('mazes/linear_maze.txt', QueueFrontier())
     maze._maze = []
     self.assertEqual(0, maze._get_height())
Exemple #10
0
 def testGetHeightMazeIsNone(self):
     maze = Maze('mazes/linear_maze.txt', QueueFrontier())
     maze._maze = None
     self.assertEqual(0, maze._get_height())
Exemple #11
0
 def testIsMazeCompleteRectangleMazeIsSingleSpaceShouldBeFalse(self):
     maze = Maze('mazes/linear_maze.txt', QueueFrontier())
     maze._maze = [[' ']]
     self.assertFalse(maze._is_maze_complete_rectangle())
Exemple #12
0
 def testIsMazeCompleteRectangleMazeIsSingleHashShouldBeTrue(self):
     maze = Maze('mazes/linear_maze.txt', QueueFrontier())
     maze._maze = [['#']]
     self.assertTrue(maze._is_maze_complete_rectangle())