From 0e6896fbe2919304ae94807ee8444d2ff62d8145 Mon Sep 17 00:00:00 2001 From: salemsd Date: Fri, 10 Jan 2025 16:52:43 +0100 Subject: [PATCH] feat(api): minor try catch change --- src/antares/craft/service/api_services/study_api.py | 4 ++-- tests/integration/test_web_client.py | 7 +------ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/antares/craft/service/api_services/study_api.py b/src/antares/craft/service/api_services/study_api.py index 4e07296..7c63e7c 100644 --- a/src/antares/craft/service/api_services/study_api.py +++ b/src/antares/craft/service/api_services/study_api.py @@ -24,7 +24,7 @@ StudySettingsUpdateError, StudyVariantCreationError, TaskFailedError, - ThermalTimeseriesGenerationError, + ThermalTimeseriesGenerationError, TaskTimeOutError, ) from antares.craft.model.binding_constraint import BindingConstraint from antares.craft.model.output import Output @@ -172,5 +172,5 @@ def generate_thermal_timeseries(self) -> None: response = self._wrapper.put(url) task_id = response.json() wait_task_completion(self._base_url, self._wrapper, task_id) - except (APIError, TaskFailedError) as e: + except (APIError, TaskFailedError, TaskTimeOutError) as e: raise ThermalTimeseriesGenerationError(self.study_id, e.message) diff --git a/tests/integration/test_web_client.py b/tests/integration/test_web_client.py index bccbb51..8e766ab 100644 --- a/tests/integration/test_web_client.py +++ b/tests/integration/test_web_client.py @@ -626,9 +626,4 @@ def test_creation_lifecycle(self, antares_web: AntaresWebDesktop): # delete_outputs study.delete_outputs() assert len(study.get_outputs()) == 0 - assert len(study.read_outputs()) == 0 - - # areas = study.get_areas() - # for area_id, area in areas.items(): - # for cluster in area.get_thermals().values(): - # area._thermal_service.update_thermal_properties(cluster, ThermalClusterProperties(nominal_capacity=1000)) + assert len(study.read_outputs()) == 0 \ No newline at end of file