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)
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)
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)
def test_no_initial_placement(self): test_robot = Robot() test_robot.move() result = test_robot.report() self.assertEqual((None, None, None), result)