Prepare State Hub retirement baseline
This commit is contained in:
parent
2217bdd9f5
commit
5927591be8
46 changed files with 32583 additions and 62 deletions
40
tests/test_codex_mcp_launcher.py
Normal file
40
tests/test_codex_mcp_launcher.py
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
import os
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
LAUNCHER = ROOT / "scripts" / "codex-state-hub-mcp.sh"
|
||||
|
||||
|
||||
def test_codex_mcp_launcher_uses_configured_python(tmp_path: Path) -> None:
|
||||
fake_python = tmp_path / "python"
|
||||
fake_python.write_text(
|
||||
"#!/usr/bin/env bash\n"
|
||||
"printf 'python=%s\\nscript=%s\\ntransport=%s\\n' "
|
||||
'"$0" "$1" "$MCP_TRANSPORT"\n'
|
||||
)
|
||||
fake_python.chmod(0o755)
|
||||
env = os.environ.copy()
|
||||
env["STATE_HUB_PYTHON"] = str(fake_python)
|
||||
env["API_BASE"] = "http://127.0.0.1:8000"
|
||||
|
||||
result = subprocess.run(
|
||||
[str(LAUNCHER)],
|
||||
cwd=ROOT,
|
||||
env=env,
|
||||
text=True,
|
||||
capture_output=True,
|
||||
check=True,
|
||||
timeout=5,
|
||||
)
|
||||
|
||||
assert f"python={fake_python}" in result.stdout
|
||||
assert "script=mcp_server/codex_server.py" in result.stdout
|
||||
assert "transport=stdio" in result.stdout
|
||||
|
||||
|
||||
def test_codex_mcp_launcher_has_no_uv_runtime_dependency() -> None:
|
||||
launcher = LAUNCHER.read_text()
|
||||
assert "uv run" not in launcher
|
||||
assert ".venv/bin/python" in launcher
|
||||
Loading…
Add table
Add a link
Reference in a new issue