diff --git a/src/ansys/optislang/core/tcp/nodes.py b/src/ansys/optislang/core/tcp/nodes.py index cbf6aceb3..539804f6c 100644 --- a/src/ansys/optislang/core/tcp/nodes.py +++ b/src/ansys/optislang/core/tcp/nodes.py @@ -2201,7 +2201,7 @@ def save_designs_as_json(self, hid: str, file_path: Union[Path, str]) -> File: ValueError Raised when ``hid`` does not exist. """ - self.__save_designs_as(hid, file_path, FileOutputFormat.JSON) + return self.__save_designs_as(hid, file_path, FileOutputFormat.JSON) def save_designs_as_csv(self, hid: str, file_path: Union[Path, str]) -> File: """Save designs for a given state to CSV file. @@ -2233,7 +2233,7 @@ def save_designs_as_csv(self, hid: str, file_path: Union[Path, str]) -> File: ValueError Raised when ``hid`` does not exist. """ - self.__save_designs_as(hid, file_path, FileOutputFormat.CSV) + return self.__save_designs_as(hid, file_path, FileOutputFormat.CSV) def __save_designs_as(self, hid: str, file_path: Union[Path, str], format: FileOutputFormat): """Save designs for a given state. diff --git a/tests/tcp/test_tcp_nodes.py b/tests/tcp/test_tcp_nodes.py index 3c49c3524..403d5da79 100644 --- a/tests/tcp/test_tcp_nodes.py +++ b/tests/tcp/test_tcp_nodes.py @@ -456,12 +456,12 @@ def test_save_designs_as(tmp_path: Path, tmp_example_project): project = osl.project root_system = project.root_system - __test_save_designs_as_json(tmp_path, root_system) __test_save_designs_as_csv(tmp_path, root_system) + __test_save_designs_as_json(tmp_path, root_system) -def __test_save_designs_as_json(tmp_path: Path, root_system: TcpRootSystemProxy): - """Test `save_designs_as_json` method.""" +def __test_save_designs_as_csv(tmp_path: Path, root_system: TcpRootSystemProxy): + """Test `save_designs_as_csv` method.""" sensitivity: TcpParametricSystemProxy = root_system.find_nodes_by_name("Sensitivity")[0] s_hids = sensitivity.get_states_ids() csv_file_path = tmp_path / "FirstDesign.csv" @@ -470,8 +470,8 @@ def __test_save_designs_as_json(tmp_path: Path, root_system: TcpRootSystemProxy) assert csv_file.exists -def __test_save_designs_as_csv(tmp_path: Path, root_system: TcpRootSystemProxy): - """Test `save_designs_as_csv` method.""" +def __test_save_designs_as_json(tmp_path: Path, root_system: TcpRootSystemProxy): + """Test `save_designs_as_json` method.""" most_inner_sensitivity: TcpParametricSystemProxy = root_system.find_nodes_by_name( "MostInnerSensitivity", 3 )[0]