Skip to content

Commit aab9a93

Browse files
committed
Add response status checks to upload tests
Inserted response.raise_for_status() calls after API requests in test_upload.py to ensure HTTP errors are caught during testing. Also refactored some assert statements for improved readability.
1 parent 80ae1fb commit aab9a93

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

tests/api/test_upload.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ def test_file_replacement_wo_metadata(self):
161161
json_str=df.json(),
162162
)
163163

164+
response.raise_for_status()
165+
164166
# Retrieve file ID
165167
file_id = response.json()["data"]["files"][0]["dataFile"]["id"]
166168

@@ -182,6 +184,8 @@ def test_file_replacement_wo_metadata(self):
182184
is_filepid=False,
183185
)
184186

187+
response.raise_for_status()
188+
185189
# Assert
186190
file_id = response.json()["data"]["files"][0]["dataFile"]["id"]
187191
content = data_api.get_datafile(file_id, is_pid=False).text

0 commit comments

Comments
 (0)