コード例 #1
0
 def test_that_get_surroundings_returns_surrounding_object(self):
     f = MazeField([
         [Wall, Wall, Wall],
         [Wall, Path, Wall],
         [Wall, Wall, Wall],
     ])
     start_position = f.get_surrounding(coordinate(2, 2))  # Path (2,2)
     self.assertIsInstance(start_position, surroundings)
コード例 #2
0
 def test_that_get_surroundings_returns_walls(self):
     f = MazeField([
         [Wall, Wall, Wall],
         [Wall, Path, Wall],
         [Wall, Wall, Wall],
     ])
     start_position = f.get_surrounding(coordinate(2, 2))  # Path (2,2)
     self.assertEqual(
         start_position,
         surroundings(
             right=Wall,
             left=Wall,
             up=Wall,
             down=Wall,
         ))
コード例 #3
0
 def test_that_get_surroundings_returns_attributes_of_coordinate(self):
     f = MazeField([
         [Wall, Wall, Wall, Wall],
         [Wall, Path, Path, Wall],
         [Wall, Wall, Finish, Wall],
         [Wall, Wall, Wall, Wall],
     ])
     start_position = f.get_surrounding(coordinate(3, 2))  # Path (3, 3)
     self.assertEqual(
         start_position,
         surroundings(
             right=Wall,
             left=Path,
             up=Wall,
             down=Finish,
         ))