summaryrefslogtreecommitdiff
path: root/test/test_util.py
diff options
context:
space:
mode:
authorMatthew L Daniel <mdaniel@gmail.com>2014-08-22 15:44:22 -0700
committerMatthew L Daniel <mdaniel@gmail.com>2014-08-22 15:44:22 -0700
commitb4bdd8eabdfd5a5df894eb3aad29743f984e20e0 (patch)
treec52c3f973c5b857071d5eb1ed5c92d6a86c2c3ee /test/test_util.py
parent08c29452f88ebc58891418b05fb50ddf24dff663 (diff)
downloadkafka-python-b4bdd8eabdfd5a5df894eb3aad29743f984e20e0.tar.gz
PEP8 fixes
Diffstat (limited to 'test/test_util.py')
-rw-r--r--test/test_util.py23
1 files changed, 11 insertions, 12 deletions
diff --git a/test/test_util.py b/test/test_util.py
index 8179b01..3f6e2f1 100644
--- a/test/test_util.py
+++ b/test/test_util.py
@@ -1,10 +1,10 @@
-import os
-import random
+# -*- coding: utf-8 -*-
import struct
import unittest2
import kafka.util
import kafka.common
+
class UtilTest(unittest2.TestCase):
@unittest2.skip("Unwritten")
def test_relative_unpack(self):
@@ -64,21 +64,20 @@ class UtilTest(unittest2.TestCase):
self.assertEqual(kafka.util.read_short_string('\x00\x00', 0), ('', 2))
self.assertEqual(kafka.util.read_short_string('\x00\x0bsome string', 0), ('some string', 13))
- def test_read_int_string__insufficient_data(self):
+ def test_read_int_string__insufficient_data2(self):
with self.assertRaises(kafka.common.BufferUnderflowError):
kafka.util.read_int_string('\x00\x021', 0)
- def test_relative_unpack(self):
+ def test_relative_unpack2(self):
self.assertEqual(
kafka.util.relative_unpack('>hh', '\x00\x01\x00\x00\x02', 0),
((1, 0), 4)
)
- def test_relative_unpack(self):
+ def test_relative_unpack3(self):
with self.assertRaises(kafka.common.BufferUnderflowError):
kafka.util.relative_unpack('>hh', '\x00', 0)
-
def test_group_by_topic_and_partition(self):
t = kafka.common.TopicAndPartition
@@ -91,12 +90,12 @@ class UtilTest(unittest2.TestCase):
]
self.assertEqual(kafka.util.group_by_topic_and_partition(l), {
- "a" : {
- 1 : t("a", 1),
- 2 : t("a", 2),
- 3 : t("a", 3),
+ "a": {
+ 1: t("a", 1),
+ 2: t("a", 2),
+ 3: t("a", 3),
},
- "b" : {
- 3 : t("b", 3),
+ "b": {
+ 3: t("b", 3),
}
})