MCPcopy Create free account
hub / github.com/BitterSecurity/Decepticon / _langgraph_command

Function _langgraph_command

tests/test_compose_langgraph_command.py:35–58  ·  view source on GitHub ↗

Render compose and return the langgraph service's command as a single string.

(env_overrides: dict[str, str])

Source from the content-addressed store, hash-verified

33
34
35def _langgraph_command(env_overrides: dict[str, str]) -> str:
36 """Render compose and return the langgraph service's command as a single string."""
37 if shutil.which("docker") is None:
38 pytest.skip("docker CLI not available")
39 env = {**os.environ, **env_overrides}
40 result = subprocess.run(
41 ["docker", "compose", "-f", str(COMPOSE), "config"],
42 env=env,
43 cwd=REPO_ROOT,
44 capture_output=True,
45 text=True,
46 check=False,
47 )
48 if result.returncode != 0:
49 pytest.fail(
50 f"docker compose config failed (exit {result.returncode}):\n"
51 f"--- stderr ---\n{result.stderr}\n"
52 f"--- stdout ---\n{result.stdout}"
53 )
54 rendered = yaml.safe_load(result.stdout)
55 cmd = (rendered.get("services") or {}).get("langgraph", {}).get("command")
56 if cmd is None:
57 pytest.fail("langgraph service has no `command` after compose render")
58 return cmd if isinstance(cmd, str) else " ".join(cmd)
59
60
61def test_default_command_includes_allow_blocking():

Calls 2

runMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected