summaryrefslogtreecommitdiff
path: root/t/unit
diff options
context:
space:
mode:
Diffstat (limited to 't/unit')
-rw-r--r--t/unit/utils/test_json.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/t/unit/utils/test_json.py b/t/unit/utils/test_json.py
index 6af1c13b..d6a9c0b0 100644
--- a/t/unit/utils/test_json.py
+++ b/t/unit/utils/test_json.py
@@ -6,6 +6,8 @@ from uuid import uuid4
import pytest
import pytz
+from hypothesis import given, settings
+from hypothesis import strategies as st
from kombu.utils.encoding import str_to_bytes
from kombu.utils.json import _DecodeError, dumps, loads
@@ -39,6 +41,16 @@ class test_JSONEncoder:
'date': stripped.isoformat(),
}
+ @given(message=st.binary())
+ @settings(print_blob=True)
+ def test_binary(self, message):
+ serialized = loads(dumps({
+ 'args': (message,),
+ }))
+ assert serialized == {
+ 'args': [message],
+ }
+
def test_Decimal(self):
d = Decimal('3314132.13363235235324234123213213214134')
assert loads(dumps({'d': d})), {'d': str(d)}