Files
hermes-webui/tests
Samuel Gudi 6fb1c24d60 test(mcp): wire-format coverage + --profile CLI ordering regression (#1895)
Maintainer review on #1895 asked for two test additions:

TestApiWireFormat — stands up a tiny http.server stub on a free port,
points WEBUI_URL at it, and captures (path, body, headers) of every
request the MCP issues:
  - test_rename_session_posts_to_canonical_path: locks /api/session/rename
    URL + body shape so a typo in the path or field names cannot slip
    through validation-only tests.
  - test_move_session_posts_to_canonical_path: same for /api/session/move
    including profile pre-flight against a real local project.
  - test_move_session_unassign_sends_null_project_id: explicit JSON null
    in the body, not an omitted key.
  - test_url_built_from_env_vars: HERMES_WEBUI_HOST/HERMES_WEBUI_PORT
    flow through to WEBUI_URL — would have caught the original 8788 bug.
  - test_url_default_when_env_unset: default 127.0.0.1:8787 matches the
    upstream contract from api/config.py:33.

TestProfileCliOrdering — locks the --profile CLI ordering invariant
(mcp_server.py:62-64): the override of _active_profile must bind before
any consumer reads it. Today this is safe because get_active_profile_name
reads the module global lazily, but a regression that latched the value
at import time would silently make --profile foo a no-op.

50/50 mcp tests pass.

Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
2026-05-08 17:12:01 +00:00
..
2026-04-29 19:54:07 -07:00
2026-05-05 01:51:05 +00:00
2026-05-05 01:51:05 +00:00
2026-04-29 17:42:32 -07:00
2026-04-29 17:42:32 -07:00
2026-04-29 21:34:27 -07:00
2026-04-29 21:06:30 -07:00
2026-04-29 17:42:32 -07:00