From 18b74ee2fbbd699f761a24110f5cb163e49703e5 Mon Sep 17 00:00:00 2001 From: Federico Negri Date: Fri, 27 Oct 2023 07:59:27 +0200 Subject: [PATCH] Fix output files and paramter ids in the success criteria (#234) --- ansys/rep/client/jms/schema/task_definition.py | 4 ++-- tests/jms/test_task_definition.py | 6 +++++- tests/test_examples.py | 2 ++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ansys/rep/client/jms/schema/task_definition.py b/ansys/rep/client/jms/schema/task_definition.py index 956240b8..3f10ae48 100644 --- a/ansys/rep/client/jms/schema/task_definition.py +++ b/ansys/rep/client/jms/schema/task_definition.py @@ -56,7 +56,7 @@ class Meta(BaseSchema.Meta): fields.String(), allow_none=True, description="A list of expressions to be evaluated." ) - required_output_files = IdReferenceList( + required_output_file_ids = IdReferenceList( "File", attribute="required_output_file_ids", allow_none=True, @@ -66,7 +66,7 @@ class Meta(BaseSchema.Meta): allow_none=True, description="Flag to require all output files." ) - required_output_parameters = IdReferenceList( + required_output_parameter_ids = IdReferenceList( "ParameterDefinition", attribute="required_output_parameter_ids", allow_none=True, diff --git a/tests/jms/test_task_definition.py b/tests/jms/test_task_definition.py index f7a1c91c..eab45f78 100644 --- a/tests/jms/test_task_definition.py +++ b/tests/jms/test_task_definition.py @@ -176,6 +176,8 @@ def test_task_definition_serialization(self): expressions=[], require_all_output_files=False, require_all_output_parameters=True, + required_output_file_ids=["id1", "id2"], + required_output_parameter_ids=["id3", "id4"], return_code=0, ), use_execution_script=False, @@ -213,13 +215,15 @@ def test_task_definition_serialization(self): "FAKE_FILE_ID", ], ) - self.assertEqual( + self.assertDictEqual( serialized_task_def["success_criteria"], OrderedDict( { "return_code": 0, "expressions": [], + "required_output_file_ids": ["id1", "id2"], "require_all_output_files": False, + "required_output_parameter_ids": ["id3", "id4"], "require_all_output_parameters": True, } ), diff --git a/tests/test_examples.py b/tests/test_examples.py index 8d896a82..8aad0bde 100644 --- a/tests/test_examples.py +++ b/tests/test_examples.py @@ -23,6 +23,8 @@ def test_mapdl_motorbike_frame(self): project_api = ProjectApi(self.client, project.id) self.assertEqual(len(project_api.get_jobs()), num_jobs) + td = project_api.get_task_definitions()[0] + self.assertEqual(len(td.success_criteria.required_output_file_ids), 1) jms_api.delete_project(project)