Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
sentrivana committed Jun 5, 2023
1 parent c060e9d commit 0801e6c
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions tests/test_serializer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import re
import sys
import pytest

Expand Down Expand Up @@ -73,25 +72,6 @@ def test_bytes_serialization_repr(message_normalizer):
assert result == r"b'abc123\x80\xf0\x9f\x8d\x95'"


def test_bytearray_serialization_decode(message_normalizer):
binary = bytearray(b"abc123\x80\xf0\x9f\x8d\x95")
result = message_normalizer(binary, should_repr_strings=False)
assert result == "abc123\ufffd\U0001f355"


@pytest.mark.xfail(sys.version_info < (3,), reason="Known safe_repr bugs in Py2.7")
def test_bytearray_serialization_repr(message_normalizer):
binary = bytearray(b"abc123\x80\xf0\x9f\x8d\x95")
result = message_normalizer(binary, should_repr_strings=True)
assert result == r"bytearray(b'abc123\x80\xf0\x9f\x8d\x95')"


def test_memoryview_serialization_repr(message_normalizer):
binary = memoryview(b"abc123\x80\xf0\x9f\x8d\x95")
result = message_normalizer(binary, should_repr_strings=False)
assert re.match(r"^<memory at 0x\w+>$", result)


def test_serialize_sets(extra_normalizer):
result = extra_normalizer({1, 2, 3})
assert result == [1, 2, 3]
Expand Down

0 comments on commit 0801e6c

Please sign in to comment.