Skip to content

Commit

Permalink
test: simplify unit tests when the endpoint returns no content
Browse files Browse the repository at this point in the history
  • Loading branch information
laurent-laporte-pro committed Apr 19, 2024
1 parent ea7f102 commit 8488015
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/integration/study_data_blueprint/test_st_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def test_lifecycle__nominal(
json=[siemens_battery_id],
)
assert res.status_code == 204, res.json()
assert res.text in {"", "null"} # Old FastAPI versions return 'null'.
assert not res.text

# If the short-term storage list is empty, the deletion should be a no-op.
res = client.request(
Expand All @@ -310,7 +310,7 @@ def test_lifecycle__nominal(
json=[],
)
assert res.status_code == 204, res.json()
assert res.text in {"", "null"} # Old FastAPI versions return 'null'.
assert not res.text

# It's possible to delete multiple short-term storages at once.
# In the following example, we will create two short-term storages:
Expand Down Expand Up @@ -370,7 +370,7 @@ def test_lifecycle__nominal(
json=[grand_maison_id, duplicated_config["id"]],
)
assert res.status_code == 204, res.json()
assert res.text in {"", "null"} # Old FastAPI versions return 'null'.
assert not res.text

# Only one st-storage should remain.
res = client.get(
Expand Down

0 comments on commit 8488015

Please sign in to comment.