From 7a39cb35f54be3d91ab0985a96fcb3663f20124c Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Wed, 22 Jun 2016 10:07:12 -0400 Subject: rename test class, add a test, improve test names --- tests/unittests/test_data.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'tests/unittests') 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) -- cgit v1.2.3