summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohn Anderson <sontek@gmail.com>2015-01-23 15:39:15 -0800
committerJohn Anderson <sontek@gmail.com>2015-01-23 15:39:15 -0800
commit3a52d18faf0d46d3611e9fc274a03877c88f118e (patch)
tree9d9fd8e2b17d7aa4a656d0c4774977c387fed74c /test
parent587206ff6ad59ae01248d24ff9c9fadbdfc1c1fc (diff)
downloadkafka-python-3a52d18faf0d46d3611e9fc274a03877c88f118e.tar.gz
Alert if the topic is not sent as bytes
Diffstat (limited to 'test')
-rw-r--r--test/test_producer.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/test_producer.py b/test/test_producer.py
index caf8fe3..119930f 100644
--- a/test/test_producer.py
+++ b/test/test_producer.py
@@ -25,3 +25,14 @@ class TestKafkaProducer(unittest.TestCase):
# This should not raise an exception
producer.send_messages(topic, partition, m)
+ def test_topic_message_types(self):
+ from kafka.producer.simple import SimpleProducer
+
+ producer = SimpleProducer(MagicMock())
+ topic = "test-topic"
+ partition = 0
+
+ def send_message():
+ producer.send_messages(topic, partition, b'hi')
+
+ self.assertRaises(TypeError, send_message)