fix(tests): isolate tests from user ~/.hermes/ config and SOUL.md

_make_cli() now patches CLI_CONFIG with clean defaults so
test_cli_init tests don't depend on the developer's local config.yaml.
test_empty_dir_returns_empty now mocks Path.home() so it doesn't pick
up a global SOUL.md.

Credit to teyrebaz33 for identifying and fixing these in PR #557.
Fixes #555.
This commit is contained in:
teknium1 2026-03-06 17:10:35 -08:00
parent 6cd3bc6640
commit 2a68099675
2 changed files with 19 additions and 2 deletions

View file

@ -172,7 +172,11 @@ class TestBuildSkillsSystemPrompt:
class TestBuildContextFilesPrompt:
def test_empty_dir_returns_empty(self, tmp_path):
result = build_context_files_prompt(cwd=str(tmp_path))
from unittest.mock import patch
fake_home = tmp_path / "fake_home"
fake_home.mkdir()
with patch("pathlib.Path.home", return_value=fake_home):
result = build_context_files_prompt(cwd=str(tmp_path))
assert result == ""
def test_loads_agents_md(self, tmp_path):