'BlockingChannel.tx_commit'

def test(self):

    connection = self._connect()
    ch = connection.channel()
    q_name = ('TestTxCommit_q' + uuid.uuid1().hex)
    ch.queue_declare(q_name, auto_delete=True)
    self.addCleanup(self._connect().channel().queue_delete, q_name)
    frame = ch.tx_select()
    self.assertIsInstance(frame.method, pika.spec.Tx.SelectOk)
    ch.publish(exchange='', routing_key=q_name, body='TestTxCommit1', mandatory=True)
    frame = ch.queue_declare(q_name, passive=True)
    self.assertEqual(frame.method.message_count, 0)
    ch.tx_commit()
    frame = ch.queue_declare(q_name, passive=True)
    self.assertEqual(frame.method.message_count, 1)
    (_, _, rx_body) = ch.basic_get(q_name, no_ack=False)
    self.assertEqual(rx_body, as_bytes('TestTxCommit1'))
