'Test DCP properties of partial optimize.'

def test_partial_optimize_dcp(self):

    dims = 3
    (x, t) = (Variable(dims), Variable(dims))
    xval = ([(-5)] * dims)
    p2 = Problem(cvxpy.Minimize(sum_entries(t)), [((- t) <= x), (x <= t)])
    g = cvxpy.partial_optimize(p2, [t], [x])
    self.assertEqual(g.curvature, s.CONVEX)
    p2 = Problem(cvxpy.Maximize(sum_entries(t)), [((- t) <= x), (x <= t)])
    g = cvxpy.partial_optimize(p2, [t], [x])
    self.assertEqual(g.curvature, s.CONCAVE)
    p2 = Problem(cvxpy.Maximize(square(t[0])), [((- t) <= x), (x <= t)])
    g = cvxpy.partial_optimize(p2, [t], [x])
    self.assertEquals(g.is_convex(), False)
    self.assertEquals(g.is_concave(), False)
