From b3e8a25a987e3ff406173bc61dc1b714db4981f1 Mon Sep 17 00:00:00 2001 From: Laurent LAPORTE Date: Wed, 6 Sep 2023 14:22:38 +0200 Subject: [PATCH] test: simplify unit tests when the endpoint returns no content --- tests/integration/study_data_blueprint/test_st_storage.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/integration/study_data_blueprint/test_st_storage.py b/tests/integration/study_data_blueprint/test_st_storage.py index cdd0b464c7..8f57b1297e 100644 --- a/tests/integration/study_data_blueprint/test_st_storage.py +++ b/tests/integration/study_data_blueprint/test_st_storage.py @@ -240,7 +240,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 # deletion of short-term storages with empty list res = client.request( @@ -250,7 +250,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 # deletion of short-term storages with multiple IDs res = client.post( @@ -278,7 +278,7 @@ def test_lifecycle__nominal( json=[siemens_battery_id1, siemens_battery_id2], ) assert res.status_code == 204, res.json() - assert res.text in {"", "null"} # Old FastAPI versions return 'null'. + assert not res.text # Check the removal res = client.get(