Commit d0ba9249 authored by Kostas Chartsias's avatar Kostas Chartsias
Browse files

refactor: formatting test cases, #8

parent a248b88d
Loading
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -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)
@@ -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()
+3 −1
Original line number Diff line number Diff line
@@ -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)