Example #1
0
 def test_getting_4_directions_for_2_dimensional_space(self):
     directions = Direction.get_all_directions(ndims=2)
     expected = [Direction(1, 1), Direction(1, -1), Direction(-1, 1), Direction(-1, -1)]
     self.assertEqual(expected, directions)
Example #2
0
 def test_getting_2_to_the_n_directions_for_n_dimensional_space(self):
     n = 5
     directions = Direction.get_all_directions(ndims=n)
     self.assertEqual(2**n, len(directions))
Example #3
0
 def test_getting_2_directions_for_1_dimensional_space(self):
     directions = Direction.get_all_directions(ndims=1)
     self.assertEqual([Direction(1), Direction(-1)], directions)