summaryrefslogtreecommitdiff
path: root/tests/unittests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unittests')
-rw-r--r--tests/unittests/test_data.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/unittests/test_data.py b/tests/unittests/test_data.py
index 17951117..13db8a4c 100644
--- a/tests/unittests/test_data.py
+++ b/tests/unittests/test_data.py
@@ -559,12 +559,17 @@ class TestUDProcess(helpers.ResourceUsingTestCase):
self.assertTrue(count_messages(message) == 1)
-class TestConvert(helpers.TestCase):
- def test_handles_binary(self):
+class TestConvertString(helpers.TestCase):
+ def test_handles_binary_non_utf8_decodable(self):
blob = b'\x32\x99'
msg = ud.convert_string(blob)
self.assertEqual(blob, msg.get_payload(decode=True))
+ def test_handles_binary_utf8_decodable(self):
+ blob = b'\x32\x32'
+ msg = ud.convert_string(blob)
+ self.assertEqual(blob, msg.get_payload(decode=True))
+
def test_handle_headers(self):
text = "hi mom"
msg = ud.convert_string(text)