diff options
author | Patrick Lucas <plucas@yelp.com> | 2014-05-03 11:27:57 -0700 |
---|---|---|
committer | Patrick Lucas <plucas@yelp.com> | 2014-05-03 16:09:33 -0700 |
commit | 671b74ab2e035a2f2ba7f90419794f6dbec08366 (patch) | |
tree | 001041ce79d2f87b6d2d8b20dcaa28aed3588967 /test/test_unit.py | |
parent | 2415609ce0899ef53e761e7ccb13177782d46c4e (diff) | |
download | kafka-python-671b74ab2e035a2f2ba7f90419794f6dbec08366.tar.gz |
Add 'codec' parameter to Producer
Adds a codec parameter to Producer.__init__ that lets the user choose
a compression codec to use for all messages sent by it.
Diffstat (limited to 'test/test_unit.py')
-rw-r--r-- | test/test_unit.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/test_unit.py b/test/test_unit.py index 8c0dd00..334ff97 100644 --- a/test/test_unit.py +++ b/test/test_unit.py @@ -135,8 +135,8 @@ class TestProtocol(unittest.TestCase): payloads = ["v1", "v2"] msg = create_gzip_message(payloads) self.assertEqual(msg.magic, 0) - self.assertEqual(msg.attributes, KafkaProtocol.ATTRIBUTE_CODEC_MASK & - KafkaProtocol.CODEC_GZIP) + self.assertEqual(msg.attributes, ATTRIBUTE_CODEC_MASK & + CODEC_GZIP) self.assertEqual(msg.key, None) # Need to decode to check since gzipped payload is non-deterministic decoded = gzip_decode(msg.value) @@ -151,8 +151,8 @@ class TestProtocol(unittest.TestCase): payloads = ["v1", "v2"] msg = create_snappy_message(payloads) self.assertEqual(msg.magic, 0) - self.assertEqual(msg.attributes, KafkaProtocol.ATTRIBUTE_CODEC_MASK & - KafkaProtocol.CODEC_SNAPPY) + self.assertEqual(msg.attributes, ATTRIBUTE_CODEC_MASK & + CODEC_SNAPPY) self.assertEqual(msg.key, None) expect = ("8\x00\x00\x19\x01@\x10L\x9f[\xc2\x00\x00\xff\xff\xff\xff" "\x00\x00\x00\x02v1\x19\x1bD\x00\x10\xd5\x96\nx\x00\x00\xff" |