Skip to content

Commit

Permalink
all test OK
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinBelthle committed Feb 14, 2025
1 parent e9ee59f commit 2abd365
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/antares/services/api_services/test_link_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ def test_update_links_properties_success(self):
update_properties = LinkPropertiesUpdate(filter_synthesis=filter_opt, filter_year_by_year=filter_opt)
api_model = LinkPropertiesAndUiAPI.from_user_model(None, properties)
url = f"https://antares.com/api/v1/studies/{self.study_id}/links/{self.area_from.id}/{self.area_to.id}"
mocker.put(url, status_code=200, json=api_model.model_dump(mode="json", by_alias=True))
response = {"area1": "", "area2": "", **api_model.model_dump(mode="json", by_alias=True)}
mocker.put(url, status_code=200, json=response)

self.link.update_properties(update_properties)
assert self.link.properties == properties
Expand All @@ -101,7 +102,8 @@ def test_update_links_ui_success(self):
update_ui = LinkUiUpdate(link_width=12)
api_model = LinkPropertiesAndUiAPI.from_user_model(ui, None)
url = f"https://antares.com/api/v1/studies/{self.study_id}/links/{self.area_from.id}/{self.area_to.id}"
mocker.put(url, status_code=200, json=api_model.model_dump(mode="json", by_alias=True))
response = {"area1": "", "area2": "", **api_model.model_dump(mode="json", by_alias=True)}
mocker.put(url, status_code=200, json=response)

self.link.update_ui(update_ui)
assert self.link.ui == ui
Expand Down

0 comments on commit 2abd365

Please sign in to comment.