diff --git a/tests/shard6/test_penalty.py b/tests/shard6/test_penalty.py index acf759476..b5e36eb7b 100644 --- a/tests/shard6/test_penalty.py +++ b/tests/shard6/test_penalty.py @@ -16,6 +16,8 @@ MultinodeConstraintList, MultinodeConstraint, MultinodeObjective, + MultinodeObjectiveFcn, + MultinodeObjectiveList, Node, ControlType, PhaseDynamics, @@ -207,6 +209,17 @@ def test_penalty_targets_shapes(): npt.assert_equal(Objective([], custom_type=p, target=np.array([[1, 2]])).target.shape, (1, 2)) +def test_multinode_objective_default_weight_is_one(): + objectives = MultinodeObjectiveList() + objectives.add( + MultinodeObjectiveFcn.STATES_EQUALITY, + nodes=(Node.START, Node.END), + nodes_phase=(0, 0), + ) + + npt.assert_equal(objectives[0].weight, ObjectiveWeight(1)) + + @pytest.mark.parametrize("phase_dynamics", [PhaseDynamics.SHARED_DURING_THE_PHASE, PhaseDynamics.ONE_PER_NODE]) @pytest.mark.parametrize("penalty_origin", [ObjectiveFcn.Lagrange, ObjectiveFcn.Mayer]) @pytest.mark.parametrize("value", [0.1, -10])