@patch("dotigent.backend.app.core.agent_runtime.AgentRuntime") def test_agents_with_patched_runtime(RuntimeMock): instance = RuntimeMock.return_value instance.list_agents = AsyncMock(return_value=[{"id":"a1"}]) from dotigent.backend.app.main import app with TestClient(app) as client: resp = client.get("/agents") assert resp.json() == [{"id":"a1"}]