Skip to content

Commit

Permalink
integrated integration tests for the reading clusters methods
Browse files Browse the repository at this point in the history
  • Loading branch information
mehdiwahada committed Nov 27, 2024
1 parent 5b8d269 commit 877f53a
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/integration/test_web_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
from antares.model.st_storage import STStorageGroup, STStorageMatrixName, STStorageProperties
from antares.model.study import create_study_api
from antares.model.thermal import ThermalClusterGroup, ThermalClusterProperties
from antares.service.api_services.renewable_api import RenewableApiService
from antares.service.api_services.st_storage_api import ShortTermStorageApiService
from antares.service.api_services.thermal_api import ThermalApiService

from tests.integration.antares_web_desktop import AntaresWebDesktop

Expand Down Expand Up @@ -183,6 +186,31 @@ def test_creation_lifecycle(self, antares_web: AntaresWebDesktop):
assert storage_fr.name == st_storage_name
assert storage_fr.id == "cluster_test"

# testing
thermal_service = ThermalApiService(api_config, study_id=study.service.study_id)
renewable_service = RenewableApiService(api_config, study_id=study.service.study_id)
storage_service = ShortTermStorageApiService(api_config, study_id=study.service.study_id)
thermal_list = thermal_service.read_thermal_clusters(area_fr.id)
renewable_list = renewable_service.read_renewables(area_fr.id)
storage_list = storage_service.read_st_storages(area_fr.id)

assert len(thermal_list) == 2
assert len(renewable_list) == 2
assert len(storage_list) == 1

actual_thermal_cluster_1 = thermal_list[0]
actual_thermal_cluster_2 = thermal_list[1]
assert actual_thermal_cluster_1.id == thermal_fr.id
assert actual_thermal_cluster_2.id == thermal_value_be.id

actual_renewable_1 = renewable_list[0]
actual_renewable_2 = renewable_list[1]
assert actual_renewable_1.id == renewable_fr.id
assert actual_renewable_2.id == renewable_onshore.id

actual_storage = storage_list[0]
assert actual_storage.id == storage_fr.id

# test short term storage creation with properties
st_storage_name = "wind_onshore"
storage_properties = STStorageProperties(reservoir_capacity=0.5)
Expand Down

0 comments on commit 877f53a

Please sign in to comment.