Skip to content

Commit fff5613

Browse files
Fix mypy error: assert prepared.body is not None before hashing
1 parent 363c76b commit fff5613

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
@@ -669,6 +669,7 @@ def test_sigv4_sign_request_with_body(rest_mock: Mocker) -> None:
669669
assert prepared.headers["Original-Authorization"] == f"Bearer {existing_token}"
670670
# Non-empty body should have base64-encoded SHA256
671671
content_sha256 = prepared.headers["x-amz-content-sha256"]
672+
assert prepared.body is not None
672673
body_bytes = prepared.body.encode("utf-8") if isinstance(prepared.body, str) else prepared.body
673674
expected_sha256 = base64.b64encode(hashlib.sha256(body_bytes).digest()).decode()
674675
assert content_sha256 == expected_sha256

0 commit comments

Comments
 (0)