summaryrefslogtreecommitdiff
path: root/test/test_util.py
diff options
context:
space:
mode:
authorMatthew L Daniel <mdaniel@gmail.com>2014-08-22 15:51:40 -0700
committerMatthew L Daniel <mdaniel@gmail.com>2014-08-22 16:01:02 -0700
commita27e521fd7078a551eb09160e8880df6a509a987 (patch)
tree37c9c36dabbee8e3befa09d87b75798f796db37f /test/test_util.py
parentb4bdd8eabdfd5a5df894eb3aad29743f984e20e0 (diff)
downloadkafka-python-a27e521fd7078a551eb09160e8880df6a509a987.tar.gz
Failing test for write_int and write_short
Diffstat (limited to 'test/test_util.py')
-rw-r--r--test/test_util.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/test_util.py b/test/test_util.py
index 3f6e2f1..7b5f294 100644
--- a/test/test_util.py
+++ b/test/test_util.py
@@ -16,6 +16,14 @@ class UtilTest(unittest2.TestCase):
'\x00\x00\x00\x0bsome string'
)
+ def test_write_int_string__unicode(self):
+ with self.assertRaises(TypeError) as cm:
+ kafka.util.write_int_string(u'unicode')
+ #: :type: TypeError
+ te = cm.exception
+ self.assertIn('unicode', te.message)
+ self.assertIn('to be str', te.message)
+
def test_write_int_string__empty(self):
self.assertEqual(
kafka.util.write_int_string(''),
@@ -43,6 +51,14 @@ class UtilTest(unittest2.TestCase):
'\x00\x0bsome string'
)
+ def test_write_short_string__unicode(self):
+ with self.assertRaises(TypeError) as cm:
+ kafka.util.write_short_string(u'hello')
+ #: :type: TypeError
+ te = cm.exception
+ self.assertIn('unicode', te.message)
+ self.assertIn('to be str', te.message)
+
def test_write_short_string__empty(self):
self.assertEqual(
kafka.util.write_short_string(''),