'BlockingChannel: Test queue_declare and queue_delete'

def test(self):

    connection = self._connect()
    ch = connection.channel()
    q_name = ('TestQueueDeclareAndDelete_' + uuid.uuid1().hex)
    frame = ch.queue_declare(q_name, auto_delete=True)
    self.addCleanup(self._connect().channel().queue_delete, q_name)
    self.assertIsInstance(frame.method, pika.spec.Queue.DeclareOk)
    frame = ch.queue_declare(q_name, passive=True)
    self.assertIsInstance(frame.method, pika.spec.Queue.DeclareOk)
    frame = ch.queue_delete(q_name)
    self.assertIsInstance(frame.method, pika.spec.Queue.DeleteOk)
    with self.assertRaises(pika.exceptions.ChannelClosed) as cm:
        ch.queue_declare(q_name, passive=True)
    self.assertEqual(cm.exception.args[0], 404)
