Пример #1
0
 def test_move_west_into_danger_zone_throws_exception(self):
     with self.assertRaises(DangerousMoveException):
         rover = Rover((0, 2), "W", self.safe_zone)
         rover.move()
         self.fail("A DangerousMoveException should have been thrown")
Пример #2
0
 def test_move_south_decrease_y_coordinate_of_position(self):
     rover = Rover((1, 1), "S", self.safe_zone)
     rover.move()
     self.assertEqual(rover.position, (1, 0))
Пример #3
0
 def test_move_west_decrease_x_coordinate_of_position(self):
     rover = Rover((1, 1), "W", self.safe_zone)
     rover.move()
     self.assertEqual(rover.position, (0, 1))
Пример #4
0
 def test_move_north_increase_y_coordinate_of_position(self):
     rover = Rover((1, 1), "N", self.safe_zone)
     rover.move()
     self.assertEqual(rover.position, (1, 2))