Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinBelthle committed Oct 10, 2024
1 parent 7ed1398 commit 5527168
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions antarest/study/business/areas/renewable_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,7 @@ def duplicate_cluster(
DuplicateRenewableCluster: If a cluster with the new name already exists in the area.
"""
new_id = transform_name_to_id(new_cluster_name)
lower_new_id = new_id.lower()
if any(lower_new_id == cluster.id.lower() for cluster in self.get_clusters(study, area_id)):
if any(new_id == cluster.id for cluster in self.get_clusters(study, area_id)):
raise DuplicateRenewableCluster(area_id, new_id)

# Cluster duplication
Expand All @@ -362,7 +361,7 @@ def duplicate_cluster(
# Matrix edition
lower_source_id = source_id.lower()
source_path = f"input/renewables/series/{area_id}/{lower_source_id}/series"
new_path = f"input/renewables/series/{area_id}/{lower_new_id}/series"
new_path = f"input/renewables/series/{area_id}/{new_id}/series"

# Prepare and execute commands
storage_service = self.storage_service.get_storage(study)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def test_apply(self, empty_study: FileStudy, command_context: CommandContext) ->

clusters = configparser.ConfigParser()
clusters.read(study_path / "input" / "renewables" / "clusters" / area_id / "list.ini")
assert str(clusters[cluster_name.lower()]["name"]) == cluster_name
assert str(clusters[cluster_name.lower()]["name"]) == cluster_name.lower()
assert str(clusters[cluster_name.lower()]["ts-interpretation"]) == parameters["ts-interpretation"]

output = CreateRenewablesCluster(
Expand Down

0 comments on commit 5527168

Please sign in to comment.