import pytest

from app.agents.tools import forum as forum_tools
from app.agents.tools import schedule as schedule_tools
from app.agents.tools import search as search_tools
from app.agents.tools import task as task_tools


@pytest.mark.asyncio
@pytest.mark.parametrize(
    ("module", "label"),
    [
        (task_tools, "task"),
        (schedule_tools, "schedule"),
        (forum_tools, "forum"),
        (search_tools, "search"),
    ],
)
async def test_run_async_bridge_works_inside_running_event_loop(module, label):
    async def sample():
        return f"ok:{label}"

    result = module._run_async(sample())

    assert result == f"ok:{label}"
