async def METHOD_NAME(self):
    await self.pub_trans.open()
    mock_check_publish_size = mock.Mock(return_value=True)
    self.pub_trans._check_publish_size = mock_check_publish_size
    with self.assertRaises(TTransportException) as cm:
        await self.pub_trans.publish('foo', bytearray([0, 0, 5, 2, 3]))
    self.assertEqual(
        TTransportExceptionType.REQUEST_TOO_LARGE, cm.exception.type)