def test_Queue_from_dict(self):
    defs = {'binding_key': 'foo.#', 'exchange': 'fooex', 'exchange_type': 'topic', 'durable': True, 'auto_delete': False}
    q1 = Queue.from_dict('foo', **dict(defs))
    self.assertEqual(q1.name, 'foo')
    self.assertEqual(q1.routing_key, 'foo.#')
    self.assertEqual(q1.exchange.name, 'fooex')
    self.assertEqual(q1.exchange.type, 'topic')
    self.assertTrue(q1.durable)
    self.assertTrue(q1.exchange.durable)
    self.assertFalse(q1.auto_delete)
    self.assertFalse(q1.exchange.auto_delete)
    q2 = Queue.from_dict('foo', **dict(defs, exchange_durable=False))
    self.assertTrue(q2.durable)
    self.assertFalse(q2.exchange.durable)
    q3 = Queue.from_dict('foo', **dict(defs, exchange_auto_delete=True))
    self.assertFalse(q3.auto_delete)
    self.assertTrue(q3.exchange.auto_delete)
    q4 = Queue.from_dict('foo', **dict(defs, queue_durable=False))
    self.assertFalse(q4.durable)
    self.assertTrue(q4.exchange.durable)
    q5 = Queue.from_dict('foo', **dict(defs, queue_auto_delete=True))
    self.assertTrue(q5.auto_delete)
    self.assertFalse(q5.exchange.auto_delete)
    self.assertEqual(Queue.from_dict('foo', **dict(defs)), Queue.from_dict('foo', **dict(defs)))
def test_Queue_from_dict(self):
    defs = {'binding_key': 'foo.#', 'exchange': 'fooex', 'exchange_type': 'topic', 'durable': True, 'auto_delete': False}
    q1 = Queue.from_dict('foo', **dict(defs))
    self.assertEqual(q1.name, 'foo')
    self.assertEqual(q1.routing_key, 'foo.#')
    self.assertEqual(q1.exchange.name, 'fooex')
    self.assertEqual(q1.exchange.type, 'topic')
    self.assertTrue(q1.durable)
    self.assertTrue(q1.exchange.durable)
    self.assertFalse(q1.auto_delete)
    self.assertFalse(q1.exchange.auto_delete)
    q2 = Queue.from_dict('foo', **dict(defs, exchange_durable=False))
    self.assertTrue(q2.durable)
    self.assertFalse(q2.exchange.durable)
    q3 = Queue.from_dict('foo', **dict(defs, exchange_auto_delete=True))
    self.assertFalse(q3.auto_delete)
    self.assertTrue(q3.exchange.auto_delete)
    q4 = Queue.from_dict('foo', **dict(defs, queue_durable=False))
    self.assertFalse(q4.durable)
    self.assertTrue(q4.exchange.durable)
    q5 = Queue.from_dict('foo', **dict(defs, queue_auto_delete=True))
    self.assertTrue(q5.auto_delete)
    self.assertFalse(q5.exchange.auto_delete)
    self.assertEqual(Queue.from_dict('foo', **dict(defs)), Queue.from_dict('foo', **dict(defs)))