hermes-agent/tests/hermes_cli/test_subcommands_profile_gateway.py
teknium1 4b67380698 test: purge low-value tests, lane py13 (371 removed)
Change-detectors, tautologies, source-reading tests, redundant duplicates,
mock-echo tests and dead/unrunnable tests. Per-test rationale in the lane
ledger (category + reason for every removal).
2026-09-23 03:15:26 -07:00

69 lines
1.4 KiB
Python

"""Unit tests for extracted subcommand parser builders (profile, gateway).
Confirms the builders attach the same subactions and ``func=`` dispatch that
lived inline in ``main()`` before the god-file Phase 2 extraction.
"""
from __future__ import annotations
import argparse
from hermes_cli.subcommands.gateway import build_gateway_parser
def _h_gateway(args): # pragma: no cover - identity only
return "gateway"
def _h_proxy(args): # pragma: no cover - identity only
return "proxy"
def _h_gateway_enroll(args): # pragma: no cover - identity only
return "gateway_enroll"
def _gateway_parser():
p = argparse.ArgumentParser(prog="hermes")
sub = p.add_subparsers(dest="command")
build_gateway_parser(
sub,
cmd_gateway=_h_gateway,
cmd_proxy=_h_proxy,
cmd_gateway_enroll=_h_gateway_enroll,
)
return p
def test_gateway_enroll_dispatch():
p = _gateway_parser()
ns = p.parse_args(
[
"gateway",
"enroll",
"--token",
"tok",
"--connector-url",
"wss://connector.example.com/relay",
"--gateway-id",
"gw-1",
]
)
assert ns.command == "gateway"
assert ns.gateway_command == "enroll"
assert ns.func is _h_gateway_enroll
assert ns.token == "tok"
assert ns.connector_url == "wss://connector.example.com/relay"
assert ns.gateway_id == "gw-1"