def test_delete(self, channel): url = 'test-url' # test queue = Queue('test') queue.delete(url) # validation channel.return_value.queue_delete.assert_called_once_with(queue.name, nowait=True)
def test_declare(self, channel): url = 'test-url' # test queue = Queue('test') queue.declare(url) # validation channel.return_value.queue_declare.assert_called_once_with( queue.name, durable=queue.durable, exclusive=queue.exclusive, auto_delete=queue.auto_delete, arguments=None)
def test_init(self): name = 'test-queue' queue = Queue(name) self.assertEqual(queue.name, name) self.assertTrue(isinstance(queue, BaseQueue)) self.assertEqual(queue.exclusive, False) self.assertEqual(queue.auto_delete, False) self.assertEqual(queue.expiration, 0)
def test_declare_auto_delete(self, channel): url = 'test-url' # test queue = Queue('test') queue.auto_delete = True queue.expiration = 10 queue.declare(url) # validation channel.return_value.queue_declare.assert_called_once_with( queue.name, durable=queue.durable, exclusive=queue.exclusive, auto_delete=queue.auto_delete, arguments={'x-expires': queue.expiration * 1000})