'BlockingChannel.basic_nack single message'

def test(self):

    connection = self._connect()
    ch = connection.channel()
    q_name = ('TestBasicNack_q' + uuid.uuid1().hex)
    ch.confirm_delivery()
    ch.queue_declare(q_name, auto_delete=True)
    self.addCleanup(self._connect().channel().queue_delete, q_name)
    ch.publish(exchange='', routing_key=q_name, body='TestBasicNack1', mandatory=True)
    ch.publish(exchange='', routing_key=q_name, body='TestBasicNack2', mandatory=True)
    (rx_method, _, rx_body) = ch.basic_get(q_name, no_ack=False)
    self.assertEqual(rx_body, as_bytes('TestBasicNack1'))
    (rx_method, _, rx_body) = ch.basic_get(q_name, no_ack=False)
    self.assertEqual(rx_body, as_bytes('TestBasicNack2'))
    ch.basic_nack(rx_method.delivery_tag, multiple=False, requeue=True)
    self._assert_exact_message_count_with_retries(channel=ch, queue=q_name, expected_count=1)
    (rx_method, _, rx_body) = ch.basic_get(q_name, no_ack=False)
    self.assertEqual(rx_body, as_bytes('TestBasicNack2'))
