Transformed to cnf formula (supported by more solvers)
@@ -7,18 +7,15 @@ class TestSolveAll(unittest.TestCase):
def test_solveall_no_obj(self):
- x = cp.intvar(0,3, shape=3)
- m = cp.Model(cp.sum(x) <= 3)
+ a,b = cp.boolvar(shape=2)
+ m = cp.Model(a | b)
for name, solver in cp.SolverLookup.base_solvers():
if not solver.supported():
continue
- try:
solver = cp.SolverLookup.get(name,model=m)
- self.assertEqual(20, solver.solveAll(solution_limit=1000))
- except NotImplementedError:
- pass # solver does not support constraint or solveAll
+ self.assertEqual(3, solver.solveAll(solution_limit=1000))
def test_solveall_with_obj(self):
