We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 345dcef commit 174ec99Copy full SHA for 174ec99
test/test_objective.py
@@ -26,6 +26,14 @@ def quadratic_objective() -> Objective:
26
return m.objective
27
28
29
+def test_set_objective_from_variable() -> None:
30
+ m = Model()
31
+ v = m.add_variables(coords=[[1, 2, 3]])
32
+ m.add_objective(v)
33
+ assert isinstance(m.objective, Objective)
34
+ assert isinstance(m.objective.expression, LinearExpression)
35
+
36
37
def test_model(linear_objective: Objective, quadratic_objective: Objective) -> None:
38
assert isinstance(linear_objective.model, Model)
39
assert isinstance(quadratic_objective.model, Model)
0 commit comments