コード例 #1
0
 def test_for_2d_grid(self):
     grid = MultiDimensionalGrid(grid_shape=(2, 3))
     all_positions = list(grid.get_positions())
     expected = [(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2)]
     self.assertEqual(expected, all_positions)
コード例 #2
0
 def test_for_1d_grid(self):
     grid = MultiDimensionalGrid(grid_shape=(3, ))
     all_positions = list(grid.get_positions())
     self.assertEqual([(0, ), (1, ), (2, )], all_positions)