Cosmetics

This commit is contained in:
Ask Solem 2012-03-23 17:28:53 +00:00
parent eb6216aeae
commit 9bf43fd9e9
3 changed files with 8 additions and 5 deletions

View File

@ -15,7 +15,7 @@ class test_misc(TestCase):
def test_iterconsume(self):
class Connection(object):
class MyConnection(object):
drained = 0
def drain_events(self, *args, **kwargs):
@ -28,7 +28,7 @@ class test_misc(TestCase):
def consume(self, *args, **kwargs):
self.active = True
conn = Connection()
conn = MyConnection()
consumer = Consumer()
it = compat._iterconsume(conn, consumer)
self.assertEqual(it.next(), 1)

View File

@ -436,7 +436,9 @@ class test_Channel(TestCase):
c.smembers.return_value = []
# We assert, that there should be at least one entry in the table.
self.assertRaises(AssertionError, self.channel.get_table, 'celery')
with self.assertRaises(AssertionError):
self.channel.get_table("celery")
class test_Redis(TestCase):

View File

@ -284,8 +284,9 @@ class Channel(virtual.Channel):
tables = [tuple(val.split(self.sep))
for val in self._avail_client.smembers(
self.keyprefix_queue % exchange)]
assert len(tables) > 0, 'Queue list empty or key does not exist: %s' % (
self.keyprefix_queue % exchange)
assert(len(tables) > 0,
'Queue list empty or key does not exist: %s' % (
self.keyprefix_queue % exchange))
return tables
def _purge(self, queue):