

def test_drain_events_unregistered_queue(self):
    c1 = self.c.channel()
    producer = self.c.Producer()
    consumer = self.c.Consumer([self.q2])
    producer.publish({
        'hello': 'world',
    }, declare=consumer.queues, routing_key=self.q2.routing_key, exchange=self.q2.exchange)
    message = consumer.queues[0].get()._raw

    class Cycle(object):

        def get(self, timeout=None):
            return ((message, 'foo'), c1)
    self.c.transport.cycle = Cycle()
    self.c.drain_events()

dataset/ETHPy150Open celery/kombu/kombu/tests/transport/test_memory.py test_MemoryTransport.test_drain_events_unregistered_queue/original