Skip to content
This repository has been archived by the owner on Mar 24, 2021. It is now read-only.

Commit

Permalink
Remove more dead code.
Browse files Browse the repository at this point in the history
  • Loading branch information
kbourgoin committed Apr 24, 2015
1 parent 55288cc commit 1a05baf
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 108 deletions.
23 changes: 0 additions & 23 deletions pykafka/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,6 @@
limitations under the License.
"""

def attribute_repr(*attributes):
"""
Provides an alternative ``__repr__`` implementation that adds the values of
the given attributes to the output as a development and debugging aid.
For example::
>>> class Foo(object):
... __repr__ = attribute_repr('pk', 'slug')
<foo.models.Foo at 0x100614c50: pk=1, slug=foo>
:param \*attributes: a sequence of strings that will be used for attribute
dereferencing on ``self``.
"""
def _repr(self):
cls = self.__class__
pairs = ('%s=%s' % (attribute, repr(getattr(self, attribute, None)))
for attribute in attributes)
return u'<%s.%s at 0x%x: %s>' % (
cls.__module__, cls.__name__, id(self), ', '.join(pairs))
return _repr


class Serializable(object):
def __len__(self):
"""Length of the bytes that will be sent to the Kafka server."""
Expand Down
43 changes: 0 additions & 43 deletions pykafka/utils/functional.py

This file was deleted.

14 changes: 7 additions & 7 deletions tests/pykafka/test_protocol.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import unittest
import unittest2

from pykafka import exceptions
from pykafka import protocol
from pykafka.common import CompressionType


class TestMetadataAPI(unittest.TestCase):
class TestMetadataAPI(unittest2.TestCase):
def test_request(self):
req = protocol.MetadataRequest()
msg = req.get_bytes()
Expand Down Expand Up @@ -44,7 +44,7 @@ def test_topic_error(self):
)


class TestProduceAPI(unittest.TestCase):
class TestProduceAPI(unittest2.TestCase):
test_messages = [
protocol.Message('this is a test message', partition_key='asdf'),
protocol.Message('this is also a test message', partition_key='test_key'),
Expand Down Expand Up @@ -88,7 +88,7 @@ def test_response(self):
self.assertEqual(response.topics, {'test': {0: 2}})


class TestFetchAPI(unittest.TestCase):
class TestFetchAPI(unittest2.TestCase):
def test_request(self):
preq = protocol.PartitionFetchRequest('test', 0, 1)
req = protocol.FetchRequest(partition_requests=[preq, ])
Expand Down Expand Up @@ -152,7 +152,7 @@ def test_snappy_decompression(self):
)


class TestOffsetAPI(unittest.TestCase):
class TestOffsetAPI(unittest2.TestCase):
def test_request(self):
preq = protocol.PartitionOffsetRequest('test', 0, -1, 1)
req = protocol.OffsetRequest(partition_requests=[preq, ])
Expand All @@ -177,7 +177,7 @@ def test_response(self):
self.assertEqual(resp.topics['test'], {0: [2]})


class TestOffsetCommitFetchAPI(unittest.TestCase):
class TestOffsetCommitFetchAPI(unittest2.TestCase):
def test_consumer_metadata_request(self):
req = protocol.ConsumerMetadataRequest('test')
msg = req.get_bytes()
Expand Down Expand Up @@ -228,4 +228,4 @@ def test_offset_fetch_response(self):


if __name__ == '__main__':
unittest.main()
unittest2.main()
35 changes: 0 additions & 35 deletions tests/pykafka/utils/test_functional.py

This file was deleted.

0 comments on commit 1a05baf

Please sign in to comment.