'Code from the advanced tutorial.'

def test_advanced(self):

    x = Variable(2)
    obj = Minimize((x[0] + norm(x, 1)))
    constraints = [(x >= 2)]
    prob = Problem(obj, constraints)
    prob.solve(solver=ECOS)
    print('optimal    value    with    ECOS:', prob.value)
    self.assertAlmostEqual(prob.value, 6)
    prob.solve(solver=ECOS_BB)
    print('optimal    value    with    ECOS_BB:', prob.value)
    self.assertAlmostEqual(prob.value, 6)
    if (CVXOPT in installed_solvers()):
        prob.solve(solver=CVXOPT)
        print('optimal    value    with    CVXOPT:', prob.value)
        self.assertAlmostEqual(prob.value, 6)
    prob.solve(solver=SCS)
    print('optimal    value    with    SCS:', prob.value)
    self.assertAlmostEqual(prob.value, 6, places=2)
    if (GLPK in installed_solvers()):
        prob.solve(solver=GLPK)
        print('optimal    value    with    GLPK:', prob.value)
        self.assertAlmostEqual(prob.value, 6)
        prob.solve(solver=GLPK_MI)
        print('optimal    value    with    GLPK_MI:', prob.value)
        self.assertAlmostEqual(prob.value, 6)
    if (GUROBI in installed_solvers()):
        prob.solve(solver=GUROBI)
        print('optimal    value    with    GUROBI:', prob.value)
        self.assertAlmostEqual(prob.value, 6)
    if (XPRESS in installed_solvers()):
        prob.solve(solver=XPRESS)
        print('optimal    value    with    Xpress:', prob.value)
        self.assertAlmostEqual(prob.value, 6)
    print(installed_solvers())
