b4fbd6fe9f
Deploy Site / deploy-vercel (push) Has been skipped
Deploy Site / deploy-docs (push) Has been skipped
Build Skills Index / build-index (push) Has been skipped
CI / Deny unrelated histories (push) Has been skipped
CI / Detect affected areas (push) Successful in 27m35s
CI / OSV scan (push) Failing after 4s
CI / Build&Test Docker image (push) Successful in 9s
CI / Supply-chain scan (push) Has been skipped
CI / Lint Docker scripts (push) Failing after 5m13s
CI / Check contributors (push) Failing after 12m8s
CI / Docs Site (push) Failing after 12m8s
CI / TypeScript (push) Failing after 12m8s
CI / Python lints (push) Failing after 12m9s
CI / Python tests (push) Failing after 12m9s
CI / Check uv.lock (push) Failing after 23m22s
CI / CI timing report (push) Has been cancelled
Build Skills Index / trigger-deploy (push) Has been cancelled
CI / All required checks pass (push) Has been cancelled
43 lines
1.3 KiB
Python
43 lines
1.3 KiB
Python
"""Tests for the top-level `./hermes` launcher script."""
|
|
|
|
import runpy
|
|
import sys
|
|
import types
|
|
from pathlib import Path
|
|
|
|
|
|
def test_launcher_delegates_to_argparse_entrypoint(monkeypatch):
|
|
"""`./hermes` should use `hermes_cli.main`, not the legacy Fire wrapper."""
|
|
launcher_path = Path(__file__).resolve().parents[2] / "hermes"
|
|
called = []
|
|
|
|
fake_main_module = types.ModuleType("hermes_cli.main")
|
|
|
|
def fake_main():
|
|
called.append("hermes_cli.main")
|
|
|
|
fake_main_module.main = fake_main
|
|
monkeypatch.setitem(sys.modules, "hermes_cli.main", fake_main_module)
|
|
|
|
fake_cli_module = types.ModuleType("cli")
|
|
|
|
def legacy_cli_main(*args, **kwargs):
|
|
raise AssertionError("launcher should not import cli.main")
|
|
|
|
fake_cli_module.main = legacy_cli_main
|
|
monkeypatch.setitem(sys.modules, "cli", fake_cli_module)
|
|
|
|
fake_fire_module = types.ModuleType("fire")
|
|
|
|
def legacy_fire(*args, **kwargs):
|
|
raise AssertionError("launcher should not invoke fire.Fire")
|
|
|
|
fake_fire_module.Fire = legacy_fire
|
|
monkeypatch.setitem(sys.modules, "fire", fake_fire_module)
|
|
|
|
monkeypatch.setattr(sys, "argv", [str(launcher_path), "gateway", "status"])
|
|
|
|
runpy.run_path(str(launcher_path), run_name="__main__")
|
|
|
|
assert called == ["hermes_cli.main"]
|