def test_wait(self, n='test_wait'):

    class C(compat.Consumer):

        def iterconsume(self, limit=None):
            for i in range(limit):
                (yield i)
    c = C(self.connection, queue=n, exchange=n, routing_key='rkey')
    self.assertEqual(c.wait(10), list(range(10)))
    c.close()
def test_wait(self, n='test_wait'):

    class C(compat.Consumer):

        def iterconsume(self, limit=None):
            for i in range(limit):
                (yield i)
    c = C(self.connection, queue=n, exchange=n, routing_key='rkey')
    self.assertEqual(c.wait(10), list(range(10)))
    c.close()