'BlockingChannel.basic_get'

def test(self):

    LOGGER.info('%s    STARTED    (%s)', datetime.utcnow(), self)
    connection = self._connect()
    LOGGER.info('%s    CONNECTED    (%s)', datetime.utcnow(), self)
    ch = connection.channel()
    LOGGER.info('%s    CREATED    CHANNEL    (%s)', datetime.utcnow(), self)
    q_name = ('TestBasicGet_q' + uuid.uuid1().hex)
    ch.confirm_delivery()
    LOGGER.info('%s    ENABLED    PUB-ACKS    (%s)', datetime.utcnow(), self)
    ch.queue_declare(q_name, auto_delete=True)
    self.addCleanup(self._connect().channel().queue_delete, q_name)
    LOGGER.info('%s    DECLARED    QUEUE    (%s)', datetime.utcnow(), self)
    msg = ch.basic_get(q_name, no_ack=False)
    self.assertTupleEqual(msg, (None, None, None))
    LOGGER.info('%s    GOT    FROM    EMPTY    QUEUE    (%s)', datetime.utcnow(), self)
    body = 'TestBasicGet'
    ch.publish(exchange='', routing_key=q_name, body=body, mandatory=True)
    LOGGER.info('%s    PUBLISHED    (%s)', datetime.utcnow(), self)
    (method, properties, body) = ch.basic_get(q_name, no_ack=False)
    LOGGER.info('%s    GOT    FROM    NON-EMPTY    QUEUE    (%s)', datetime.utcnow(), self)
    self.assertIsInstance(method, pika.spec.Basic.GetOk)
    self.assertEqual(method.delivery_tag, 1)
    self.assertFalse(method.redelivered)
    self.assertEqual(method.exchange, '')
    self.assertEqual(method.routing_key, q_name)
    self.assertEqual(method.message_count, 0)
    self.assertIsInstance(properties, pika.BasicProperties)
    self.assertIsNone(properties.headers)
    self.assertEqual(body, as_bytes(body))
    ch.basic_ack(delivery_tag=method.delivery_tag)
    LOGGER.info('%s    ACKED    (%s)', datetime.utcnow(), self)
    self._assert_exact_message_count_with_retries(channel=ch, queue=q_name, expected_count=0)
