Skip to content

Commit

Permalink
Remove redundant assertion of equality
Browse files Browse the repository at this point in the history
  • Loading branch information
smokestacklightnin committed Feb 4, 2025
1 parent 6cfb136 commit 5eafb6d
Showing 1 changed file with 11 additions and 19 deletions.
30 changes: 11 additions & 19 deletions tests/deploy/api/test_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,12 @@ def sorting_key(d):
response.json(), key=sorting_key
)

for document, antwort in zip(
sorted(documents, key=sorting_key), sorted(response.json(), key=sorting_key)
):
assert (
document["mime_type"]
== antwort["mime_type"]
== (
mime_type
if mime_type is not None
else mimetypes.guess_type(document_path.name)[0]
)
# Assert that the correct MIME types are returned
for antwort in response.json():
assert antwort["mime_type"] == (
mime_type
if mime_type is not None
else mimetypes.guess_type(document_path.name)[0]
)


Expand All @@ -84,14 +79,11 @@ def test_get_document(tmp_local_root, mime_type):

assert document == response.json()

assert (
document["mime_type"]
== response.json()["mime_type"]
== (
mime_type
if mime_type is not None
else mimetypes.guess_type(document_path.name)[0]
)
# Assert that the correct MIME type is returned
assert response.json()["mime_type"] == (
mime_type
if mime_type is not None
else mimetypes.guess_type(document_path.name)[0]
)


Expand Down

0 comments on commit 5eafb6d

Please sign in to comment.