Skip to content

Commit d6af40a

Browse files
Fix mypy error: assert prepared.body is not None before hashing
1 parent ab0c646 commit d6af40a

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

tests/catalog/test_rest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,7 @@ def test_sigv4_sign_request_with_body(rest_mock: Mocker) -> None:
558558
assert prepared.headers["Original-Authorization"] == f"Bearer {existing_token}"
559559
# Non-empty body should have base64-encoded SHA256
560560
content_sha256 = prepared.headers["x-amz-content-sha256"]
561+
assert prepared.body is not None
561562
body_bytes = prepared.body.encode("utf-8") if isinstance(prepared.body, str) else prepared.body
562563
expected_sha256 = base64.b64encode(hashlib.sha256(body_bytes).digest()).decode()
563564
assert content_sha256 == expected_sha256

0 commit comments

Comments
 (0)