Files
hermes-agent/tests/hermes_cli/test_commands_execute.py
teknium1 d09dacf66a test: purge low-value tests, lane py10 (412 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

17 lines
683 B
Python

"""Invariant for registry-owned slash execution (CommandDef.execute).
Every ``CommandDef`` with ``execute`` set must name a key that exists in
:data:`hermes_cli.slash_exec.EXECUTORS`; otherwise the command silently falls
through to "unknown command" on every surface.
"""
from hermes_cli.commands import COMMAND_REGISTRY
from hermes_cli.slash_exec import resolve_executor
def test_every_execute_key_resolves_to_an_executor():
migrated = [cmd for cmd in COMMAND_REGISTRY if cmd.execute]
assert migrated
unresolved = [cmd.name for cmd in migrated if resolve_executor(cmd) is None]
assert not unresolved, f"CommandDef.execute names no EXECUTORS entry: {unresolved}"