From e644caa678035cecfc6cfbf7be34bca12efe5d39 Mon Sep 17 00:00:00 2001 From: belthlemar Date: Wed, 12 Feb 2025 18:25:10 +0100 Subject: [PATCH] fix integration test --- tests/integration/test_web_client.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/integration/test_web_client.py b/tests/integration/test_web_client.py index 3dd47474..e16d68ee 100644 --- a/tests/integration/test_web_client.py +++ b/tests/integration/test_web_client.py @@ -32,6 +32,7 @@ BindingConstraintFrequency, BindingConstraintOperator, BindingConstraintProperties, + BindingConstraintPropertiesUpdate, ClusterData, ConstraintTerm, LinkData, @@ -381,7 +382,7 @@ def test_creation_lifecycle(self, antares_web: AntaresWebDesktop, tmp_path): constraint_2.update_equal_term_matrix(wrong_matrix) # Case that succeeds - properties = BindingConstraintProperties(operator="less") + properties = BindingConstraintProperties(operator=BindingConstraintOperator.LESS) matrix = pd.DataFrame(data=(np.ones((8784, 1)))) constraint_3 = study.create_binding_constraint(name="bc_3", less_term_matrix=matrix, properties=properties) assert constraint_3.get_less_term_matrix().equals(matrix) @@ -389,8 +390,8 @@ def test_creation_lifecycle(self, antares_web: AntaresWebDesktop, tmp_path): # test update constraint matrices new_matrix = pd.DataFrame(data=(np.ones((8784, 1)))) new_matrix.iloc[0, 0] = 72 - properties.operator = "equal" - constraint_3.update_properties(properties) + update_properties = BindingConstraintPropertiesUpdate(operator=BindingConstraintOperator.EQUAL) + constraint_3.update_properties(update_properties) constraint_3.update_equal_term_matrix(new_matrix) assert constraint_3.get_equal_term_matrix().equals(new_matrix) @@ -462,10 +463,10 @@ def test_creation_lifecycle(self, antares_web: AntaresWebDesktop, tmp_path): assert battery_fr.properties.reservoir_capacity == 0.5 # Checks old value wasn't modified # tests constraint properties update - new_props = BindingConstraintProperties() - new_props.group = "another_group" + new_props = BindingConstraintPropertiesUpdate(group="another_group") constraint_1.update_properties(new_props) assert constraint_1.properties.group == "another_group" + assert constraint_1.properties.enabled is False # Checks old value wasn't modified # tests constraint deletion study.delete_binding_constraint(constraint_1)