Loading tests/ai_agent/test_error_codes.py +6 −2 Original line number Diff line number Diff line Loading @@ -11,7 +11,9 @@ REPO_ROOT = pathlib.Path(__file__).resolve().parents[2] if str(REPO_ROOT) not in sys.path: sys.path.insert(0, str(REPO_ROOT)) spec = importlib.util.spec_from_file_location("test_ai_agent_app", REPO_ROOT / "ai_agent" / "app.py") spec = importlib.util.spec_from_file_location( "test_ai_agent_app", REPO_ROOT / "ai_agent" / "app.py" ) ai_agent_app = importlib.util.module_from_spec(spec) assert spec.loader is not None spec.loader.exec_module(ai_agent_app) Loading Loading @@ -43,7 +45,9 @@ def test_groq_query_agent_failure_returns_500() -> None: agent = AsyncMock() agent.run.side_effect = RuntimeError("backend failure") with patch("ai_agent.routes.groq.create_groq_agent", new=AsyncMock(return_value=agent)): with patch( "ai_agent.routes.groq.create_groq_agent", new=AsyncMock(return_value=agent) ): response = await _make_request("POST", "/groq-mcp", json={"query": "hello"}) agent.close.assert_awaited_once() Loading tests/mcp_module/test_error_codes.py +3 −1 Original line number Diff line number Diff line Loading @@ -10,7 +10,9 @@ REPO_ROOT = pathlib.Path(__file__).resolve().parents[2] if str(REPO_ROOT) not in sys.path: sys.path.insert(0, str(REPO_ROOT)) spec = importlib.util.spec_from_file_location("test_mcp_module_app", REPO_ROOT / "mcp_module" / "app.py") spec = importlib.util.spec_from_file_location( "test_mcp_module_app", REPO_ROOT / "mcp_module" / "app.py" ) mcp_module_app = importlib.util.module_from_spec(spec) assert spec.loader is not None spec.loader.exec_module(mcp_module_app) Loading Loading
tests/ai_agent/test_error_codes.py +6 −2 Original line number Diff line number Diff line Loading @@ -11,7 +11,9 @@ REPO_ROOT = pathlib.Path(__file__).resolve().parents[2] if str(REPO_ROOT) not in sys.path: sys.path.insert(0, str(REPO_ROOT)) spec = importlib.util.spec_from_file_location("test_ai_agent_app", REPO_ROOT / "ai_agent" / "app.py") spec = importlib.util.spec_from_file_location( "test_ai_agent_app", REPO_ROOT / "ai_agent" / "app.py" ) ai_agent_app = importlib.util.module_from_spec(spec) assert spec.loader is not None spec.loader.exec_module(ai_agent_app) Loading Loading @@ -43,7 +45,9 @@ def test_groq_query_agent_failure_returns_500() -> None: agent = AsyncMock() agent.run.side_effect = RuntimeError("backend failure") with patch("ai_agent.routes.groq.create_groq_agent", new=AsyncMock(return_value=agent)): with patch( "ai_agent.routes.groq.create_groq_agent", new=AsyncMock(return_value=agent) ): response = await _make_request("POST", "/groq-mcp", json={"query": "hello"}) agent.close.assert_awaited_once() Loading
tests/mcp_module/test_error_codes.py +3 −1 Original line number Diff line number Diff line Loading @@ -10,7 +10,9 @@ REPO_ROOT = pathlib.Path(__file__).resolve().parents[2] if str(REPO_ROOT) not in sys.path: sys.path.insert(0, str(REPO_ROOT)) spec = importlib.util.spec_from_file_location("test_mcp_module_app", REPO_ROOT / "mcp_module" / "app.py") spec = importlib.util.spec_from_file_location( "test_mcp_module_app", REPO_ROOT / "mcp_module" / "app.py" ) mcp_module_app = importlib.util.module_from_spec(spec) assert spec.loader is not None spec.loader.exec_module(mcp_module_app) Loading