def METHOD_NAME(self):
    """
    Test a full least-squares optimization.
    """
    with ScratchDir("."):
        for ngroups in range(1, 4):
            mpi = MpiPartition(ngroups=ngroups)
            o = TestFunction3(mpi.comm_groups)
            term1 = (o.f0, 0, 1)
            term2 = (o.f1, 0, 1)
            prob = LeastSquaresProblem.from_tuples([term1, term2])
            least_squares_mpi_solve(prob, mpi, grad=False)
            self.assertAlmostEqual(prob.x[0], 1)
            self.assertAlmostEqual(prob.x[1], 1)