def test_asyncio_request_response(connection, receiver):
    """
    Test request/response messaging pattern with coroutine callbacks
    """

    async def endpoint_handler(message):
        return message.payload + "-pong"

    connection.register_async_endpoint(endpoint_handler, "test.asyncio.request")
    connection.call_async(
        receiver.create_callback_coroutine(), "test.asyncio.request", "ping"
    )

    assert ["ping-pong"] == receiver.wait_for_messages()