Skip to main content
Glama
test_dependency_service_cli.py1.44 kB
"""Direct tests for dependency.dependency_service.""" from __future__ import annotations from types import SimpleNamespace import pytest from igloo_mcp.dependency.dependency_service import DependencyService def test_build_dependency_graph_success(monkeypatch: pytest.MonkeyPatch): captured = {} class StubCLI: def __init__(self, profile): captured["profile"] = profile monkeypatch.setattr("igloo_mcp.dependency.dependency_service.SnowCLI", StubCLI) service = DependencyService(context={"profile": "DEV"}) result = service.build_dependency_graph( database="DB", schema="SCHEMA", account_scope=False, format="json" ) assert captured["profile"] == "DEV" assert result["status"] == "success" assert result["database"] == "DB" assert result["schema"] == "SCHEMA" assert result["graph_file"].endswith("dependencies.json") def test_build_dependency_graph_failure(monkeypatch: pytest.MonkeyPatch): monkeypatch.setattr( "igloo_mcp.dependency.dependency_service.SnowCLI", lambda profile=None: SimpleNamespace(), # noqa: ARG005 ) class ExplodingFormat: def __format__(self, spec: str) -> str: # noqa: D401 raise RuntimeError("boom") service = DependencyService() result = service.build_dependency_graph(format=ExplodingFormat()) assert result["status"] == "error" assert result["error"] == "boom"

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Evan-Kim2028/igloo-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server