diff options
Diffstat (limited to 'kombu/tests/test_simple.py')
-rw-r--r-- | kombu/tests/test_simple.py | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/kombu/tests/test_simple.py b/kombu/tests/test_simple.py index 130708bf..7580e650 100644 --- a/kombu/tests/test_simple.py +++ b/kombu/tests/test_simple.py @@ -17,7 +17,7 @@ class SimpleBase(TestCase): if not isinstance(q, Queue): q = self.__class__.__name__ if name: - q = "%s.%s" % (q, name) + q = '%s.%s' % (q, name) return self._Queue(q, *args, **kwargs) def _Queue(self, *args, **kwargs): @@ -25,7 +25,7 @@ class SimpleBase(TestCase): def setUp(self): if not self.abstract: - self.connection = BrokerConnection(transport="memory") + self.connection = BrokerConnection(transport='memory') self.q = self.Queue(None, no_ack=True) def tearDown(self): @@ -36,42 +36,42 @@ class SimpleBase(TestCase): def test_produce__consume(self): if self.abstract: return - q = self.Queue("test_produce__consume", no_ack=True) + q = self.Queue('test_produce__consume', no_ack=True) - q.put({"hello": "Simple"}) + q.put({'hello': 'Simple'}) - self.assertEqual(q.get(timeout=1).payload, {"hello": "Simple"}) + self.assertEqual(q.get(timeout=1).payload, {'hello': 'Simple'}) with self.assertRaises(Empty): q.get(timeout=0.1) def test_produce__basic_get(self): if self.abstract: return - q = self.Queue("test_produce__basic_get", no_ack=True) - q.put({"hello": "SimpleSync"}) - self.assertEqual(q.get_nowait().payload, {"hello": "SimpleSync"}) + q = self.Queue('test_produce__basic_get', no_ack=True) + q.put({'hello': 'SimpleSync'}) + self.assertEqual(q.get_nowait().payload, {'hello': 'SimpleSync'}) with self.assertRaises(Empty): q.get_nowait() - q.put({"hello": "SimpleSync"}) - self.assertEqual(q.get(block=False).payload, {"hello": "SimpleSync"}) + q.put({'hello': 'SimpleSync'}) + self.assertEqual(q.get(block=False).payload, {'hello': 'SimpleSync'}) with self.assertRaises(Empty): q.get(block=False) def test_clear(self): if self.abstract: return - q = self.Queue("test_clear", no_ack=True) + q = self.Queue('test_clear', no_ack=True) for i in range(10): - q.put({"hello": "SimplePurge%d" % (i, )}) + q.put({'hello': 'SimplePurge%d' % (i, )}) self.assertEqual(q.clear(), 10) def test_enter_exit(self): if self.abstract: return - q = self.Queue("test_enter_exit") + q = self.Queue('test_enter_exit') q.close = Mock() self.assertIs(q.__enter__(), q) @@ -81,10 +81,10 @@ class SimpleBase(TestCase): def test_qsize(self): if self.abstract: return - q = self.Queue("test_clear", no_ack=True) + q = self.Queue('test_clear', no_ack=True) for i in range(10): - q.put({"hello": "SimplePurge%d" % (i, )}) + q.put({'hello': 'SimplePurge%d' % (i, )}) self.assertEqual(q.qsize(), 10) self.assertEqual(len(q), 10) @@ -93,17 +93,17 @@ class SimpleBase(TestCase): if self.abstract: return channel = self.connection.channel() - q = self.Queue("test_autoclose", no_ack=True, channel=channel) + q = self.Queue('test_autoclose', no_ack=True, channel=channel) q.close() def test_custom_Queue(self): if self.abstract: return n = self.__class__.__name__ - exchange = Exchange("%s-test.custom.Queue" % (n, )) - queue = Queue("%s-test.custom.Queue" % (n, ), + exchange = Exchange('%s-test.custom.Queue' % (n, )) + queue = Queue('%s-test.custom.Queue' % (n, ), exchange, - "my.routing.key") + 'my.routing.key') q = self.Queue(queue) self.assertEqual(q.consumer.queues[0], queue) @@ -112,7 +112,7 @@ class SimpleBase(TestCase): def test_bool(self): if self.abstract: return - q = self.Queue("test_nonzero") + q = self.Queue('test_nonzero') self.assertTrue(q) @@ -123,7 +123,7 @@ class test_SimpleQueue(SimpleBase): return self.connection.SimpleQueue(*args, **kwargs) def test_is_ack(self): - q = self.Queue("test_is_no_ack") + q = self.Queue('test_is_no_ack') self.assertFalse(q.no_ack) @@ -134,5 +134,5 @@ class test_SimpleBuffer(SimpleBase): return self.connection.SimpleBuffer(*args, **kwargs) def test_is_no_ack(self): - q = self.Queue("test_is_no_ack") + q = self.Queue('test_is_no_ack') self.assertTrue(q.no_ack) |