d73ff9b0fb
Deploy Site / deploy-vercel (push) Has been cancelled
Deploy Site / deploy-docs (push) Has been cancelled
Docker / shell lint / Lint Dockerfile (hadolint) (push) Has been cancelled
Docker / shell lint / Lint docker/ shell scripts (shellcheck) (push) Has been cancelled
Docker Build and Publish / build-amd64 (push) Has been cancelled
Docker Build and Publish / build-arm64 (push) Has been cancelled
Lint (ruff + ty) / ruff + ty diff (push) Has been cancelled
Lint (ruff + ty) / ruff enforcement (blocking) (push) Has been cancelled
Lint (ruff + ty) / Windows footguns (blocking) (push) Has been cancelled
Nix Lockfile Fix / auto-fix-main (push) Has been cancelled
Nix Lockfile Fix / fix (push) Has been cancelled
Nix / nix (macos-latest) (push) Has been cancelled
Nix / nix (ubuntu-latest) (push) Has been cancelled
OSV-Scanner / Scan lockfiles (push) Has been cancelled
Build Skills Index / build-index (push) Has been cancelled
Tests / test (1) (push) Has been cancelled
Tests / test (2) (push) Has been cancelled
Tests / test (3) (push) Has been cancelled
Tests / test (4) (push) Has been cancelled
Tests / test (5) (push) Has been cancelled
Tests / test (6) (push) Has been cancelled
Tests / e2e (push) Has been cancelled
uv.lock check / uv lock --check (push) Has been cancelled
Docker Build and Publish / merge (push) Has been cancelled
Build Skills Index / trigger-deploy (push) Has been cancelled
Tests / save-durations (push) Has been cancelled
102 lines
2.3 KiB
Python
102 lines
2.3 KiB
Python
import sys
|
|
|
|
|
|
def test_top_level_skills_flag_defaults_to_chat(monkeypatch):
|
|
import hermes_cli.main as main_mod
|
|
|
|
captured = {}
|
|
|
|
def fake_cmd_chat(args):
|
|
captured["skills"] = args.skills
|
|
captured["command"] = args.command
|
|
|
|
monkeypatch.setattr(main_mod, "cmd_chat", fake_cmd_chat)
|
|
monkeypatch.setattr(
|
|
sys,
|
|
"argv",
|
|
["hermes", "-s", "hermes-agent-dev,github-auth"],
|
|
)
|
|
|
|
main_mod.main()
|
|
|
|
assert captured == {
|
|
"skills": ["hermes-agent-dev,github-auth"],
|
|
"command": None,
|
|
}
|
|
|
|
|
|
def test_chat_subcommand_accepts_skills_flag(monkeypatch):
|
|
import hermes_cli.main as main_mod
|
|
|
|
captured = {}
|
|
|
|
def fake_cmd_chat(args):
|
|
captured["skills"] = args.skills
|
|
captured["query"] = args.query
|
|
|
|
monkeypatch.setattr(main_mod, "cmd_chat", fake_cmd_chat)
|
|
monkeypatch.setattr(
|
|
sys,
|
|
"argv",
|
|
["hermes", "chat", "-s", "github-auth", "-q", "hello"],
|
|
)
|
|
|
|
main_mod.main()
|
|
|
|
assert captured == {
|
|
"skills": ["github-auth"],
|
|
"query": "hello",
|
|
}
|
|
|
|
|
|
def test_chat_subcommand_accepts_image_flag(monkeypatch):
|
|
import hermes_cli.main as main_mod
|
|
|
|
captured = {}
|
|
|
|
def fake_cmd_chat(args):
|
|
captured["query"] = args.query
|
|
captured["image"] = args.image
|
|
|
|
monkeypatch.setattr(main_mod, "cmd_chat", fake_cmd_chat)
|
|
monkeypatch.setattr(
|
|
sys,
|
|
"argv",
|
|
["hermes", "chat", "-q", "hello", "--image", "~/storage/shared/Pictures/cat.png"],
|
|
)
|
|
|
|
main_mod.main()
|
|
|
|
assert captured == {
|
|
"query": "hello",
|
|
"image": "~/storage/shared/Pictures/cat.png",
|
|
}
|
|
|
|
|
|
def test_continue_worktree_and_skills_flags_work_together(monkeypatch):
|
|
import hermes_cli.main as main_mod
|
|
|
|
captured = {}
|
|
|
|
def fake_cmd_chat(args):
|
|
captured["continue_last"] = args.continue_last
|
|
captured["worktree"] = args.worktree
|
|
captured["skills"] = args.skills
|
|
captured["command"] = args.command
|
|
|
|
monkeypatch.setattr(main_mod, "cmd_chat", fake_cmd_chat)
|
|
monkeypatch.setattr(
|
|
sys,
|
|
"argv",
|
|
["hermes", "-c", "-w", "-s", "hermes-agent-dev"],
|
|
)
|
|
|
|
main_mod.main()
|
|
|
|
assert captured == {
|
|
"continue_last": True,
|
|
"worktree": True,
|
|
"skills": ["hermes-agent-dev"],
|
|
"command": "chat",
|
|
}
|