Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 9, 2023
1 parent 9351a28 commit 600d932
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/netcore/protocols/test_messagepack.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 600d932

Please sign in to comment.