def test_constructor(self, n='test_Consumer_constructor'):
    c = compat.Consumer(self.connection, queue=n, exchange=n, routing_key='rkey')
    self.assertIsInstance(c.backend, Channel)
    q = c.queues[0]
    self.assertTrue(q.durable)
    self.assertTrue(q.exchange.durable)
    self.assertFalse(q.auto_delete)
    self.assertFalse(q.exchange.auto_delete)
    self.assertEqual(q.name, n)
    self.assertEqual(q.exchange.name, n)
    c2 = compat.Consumer(self.connection, queue=(n + '2'), exchange=(n + '2'), routing_key='rkey', durable=False, auto_delete=True, exclusive=True)
    q2 = c2.queues[0]
    self.assertFalse(q2.durable)
    self.assertFalse(q2.exchange.durable)
    self.assertTrue(q2.auto_delete)
    self.assertTrue(q2.exchange.auto_delete)
def test_constructor(self, n='test_Consumer_constructor'):
    c = compat.Consumer(self.connection, queue=n, exchange=n, routing_key='rkey')
    self.assertIsInstance(c.backend, Channel)
    q = c.queues[0]
    self.assertTrue(q.durable)
    self.assertTrue(q.exchange.durable)
    self.assertFalse(q.auto_delete)
    self.assertFalse(q.exchange.auto_delete)
    self.assertEqual(q.name, n)
    self.assertEqual(q.exchange.name, n)
    c2 = compat.Consumer(self.connection, queue=(n + '2'), exchange=(n + '2'), routing_key='rkey', durable=False, auto_delete=True, exclusive=True)
    q2 = c2.queues[0]
    self.assertFalse(q2.durable)
    self.assertFalse(q2.exchange.durable)
    self.assertTrue(q2.auto_delete)
    self.assertTrue(q2.exchange.auto_delete)