Пример #1
0
 def test_right(self, mock_calc_right_transition, mock_is_within_boundary):
     mock_is_within_boundary.return_value = True
     mock_calc_right_transition.return_value = EAST
     test_robot = Robot()
     test_robot.place(1, 1, NORTH)
     test_robot.right()
     result = test_robot.report()
     self.assertEqual((1, 1, EAST), result)
Пример #2
0
 def test_move(self, mock_calc_x_y_vec, mock_is_within_boundary):
     mock_is_within_boundary.return_value = True
     mock_calc_x_y_vec.return_value = (0, 1)
     test_robot = Robot()
     test_robot.place(1, 1, NORTH)
     test_robot.move()
     result = test_robot.report()
     self.assertEqual((1, 2, NORTH), result)
Пример #3
0
 def test_place(self, mock_is_within_boundary):
     mock_is_within_boundary.return_value = True
     test_robot = Robot()
     test_robot.place(1, 1, SOUTH)
     result = test_robot.report()
     self.assertEqual((1, 1, SOUTH), result)
Пример #4
0
 def test_no_initial_placement(self):
     test_robot = Robot()
     test_robot.move()
     result = test_robot.report()
     self.assertEqual((None, None, None), result)