test(cron): bot-chat CLI-home test strips the launcher prefix without requiring -p

The fixture adaptation for the `python -m hermes_cli.main` launcher located the
CLI argv via `argv.index("-p")`, but profile homes (`profiles/<name>`) never get
a `-p` flag appended, so the `beta` parametrization raised ValueError inside the
fake subprocess.run and the delivery reported failure. Strip the launcher prefix
by shape instead (3 tokens for `python -m hermes_cli.main`, 1 for a binary).
This commit is contained in:
teknium1
2026-09-15 12:36:14 -07:00
committed by Teknium
parent f336048b08
commit b0bde32959
+2 -1
View File
@@ -35,7 +35,8 @@ def test_cli_keeps_discovered_home_when_launch_selection_changes(tmp_path, monke
'import hermes_cli.main; from hermes_constants import get_hermes_home; '
'print(json.dumps(str(get_hermes_home())))')
# Everything after the launcher (binary or ``python -m hermes_cli.main``) is the CLI argv.
result = real_run([sys.executable, "-c", code, json.dumps(argv[argv.index("-p"):])],
cli_argv = argv[3:] if argv[1:3] == ["-m", "hermes_cli.main"] else argv[1:]
result = real_run([sys.executable, "-c", code, json.dumps(cli_argv)],
env=kwargs["env"], capture_output=True, text=True, timeout=30)
assert result.returncode == 0, result.stderr
seen.append(Path(json.loads(result.stdout.strip().splitlines()[-1])))