Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
pre-commit-ci[bot] committed Oct 8, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 18823367ee3b98dd475dff9b72a5b5021c183caa
6 changes: 3 additions & 3 deletions tests/netcore/protocols/test_messagepack.py
Original file line number Diff line number Diff line change
@@ -27,15 +27,15 @@ def test_messagepack_protocol_write():

def test_get_size():
p = MessagePackProtocol()
assert p._get_size(b"\x01", 0) == (1, 2 ** 0)
assert p._get_size(b"\x81\x01", 0) == (2, 2 ** 7 + 2 ** 0)
assert p._get_size(b"\x01", 0) == (1, 2**0)
assert p._get_size(b"\x81\x01", 0) == (2, 2**7 + 2**0)
with pytest.raises(InvalidMessage):
p._get_size(b"\x80", 0)


def test_get_big_message_size():
p = MessagePackProtocol()
assert p._get_size(b"\x80" * 4 + b"\x03", 0) == (5, 3 * 2 ** 28)
assert p._get_size(b"\x80" * 4 + b"\x03", 0) == (5, 3 * 2**28)
with pytest.raises(InvalidMessage):
p._get_size(b"\x80" * 4 + b"\x04", 0) # 2 ** 30 bytes = 2GB