Skip to content

Commit

Permalink
really fix mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
dsschult committed Dec 21, 2023
1 parent 96fd3f4 commit 3bae579
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion resources/cleanup_scripts/restore_from_backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ async def already_in_fc(rc: RestClient, uuid: str, logical_name: str) -> bool:
await rc.request("GET", "/api/files/" + uuid)
return True
except requests.exceptions.HTTPError as e:
if e and e.response.status_code != 404:
if e.response and e.response.status_code != 404:
raise

# now sanity check that the logical_name isn't already in the FC
Expand Down
2 changes: 1 addition & 1 deletion tests/test_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ def copy_without_rest_response_keys(data: StrDict) -> StrDict:
def _assert_httperror(exception: Exception, code: int, reason: str) -> None:
"""Assert that this is the expected HTTPError."""
print(exception)
assert exception is not None
assert isinstance(exception, requests.exceptions.HTTPError)
assert exception.response is not None
assert exception.response.status_code == code
assert exception.response.reason == reason

Expand Down
2 changes: 1 addition & 1 deletion tests/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
def _assert_httperror(exception: Exception, code: int, reason: str) -> None:
"""Assert that this is the expected HTTPError."""
print(exception)
assert exception is not None
assert isinstance(exception, requests.exceptions.HTTPError)
assert exception.response is not None
assert exception.response.status_code == code
assert exception.response.reason == reason

Expand Down

0 comments on commit 3bae579

Please sign in to comment.