Skip to content

The agent that grows with you

fix(tests): return Path from get_hermes_home mock in slash_worker profile test

Lauraf84f1dd13231
diff --git a/tests/tui_gateway/test_slash_worker_profile_home.py b/tests/tui_gateway/test_slash_worker_profile_home.py
index e8589c78619..22dd576fe18 100644
--- a/tests/tui_gateway/test_slash_worker_profile_home.py
+++ b/tests/tui_gateway/test_slash_worker_profile_home.py
@@ -3,6 +3,7 @@
import os
import subprocess
import sys
+from pathlib import Path
from unittest.mock import MagicMock, patch, call
import pytest
@@ -11,7 +12,10 @@ import pytest
def test_slash_worker_accepts_profile_home():
"""_SlashWorker.__init__ accepts profile_home parameter."""
with patch.dict("sys.modules", {
- "hermes_constants": MagicMock(get_hermes_home=MagicMock(return_value="/tmp/hermes_test")),
+ # get_hermes_home() returns a Path in production; hermes_state.py's
+ # module-level DEFAULT_DB_PATH = get_hermes_home() / "state.db" does path
+ # division, so a str mock makes the import raise TypeError (str / str).
+ "hermes_constants": MagicMock(get_hermes_home=MagicMock(return_value=Path("/tmp/hermes_test"))),
}):
with patch("subprocess.Popen") as mock_popen:
mock_popen.return_value.stdout = MagicMock()