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 Dec 5, 2023
1 parent af39336 commit 2001dfe
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 @@ -245,7 +245,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 @@ -255,7 +255,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 @@ -315,7 +315,7 @@ def test_lifecycle__nominal(
json=[siemens_battery_id, grand_maison_id],
)
assert res.status_code == 204, res.json()
assert res.text in {"", "null"} # Old FastAPI versions return 'null'.
assert not res.text

# The list of short-term storages should be empty.
res = client.get(
Expand Down

0 comments on commit 2001dfe

Please sign in to comment.