diff --git a/tests/hermes_cli/test_kanban_core_functionality.py b/tests/hermes_cli/test_kanban_core_functionality.py index 551480ff72..a7896bf940 100644 --- a/tests/hermes_cli/test_kanban_core_functionality.py +++ b/tests/hermes_cli/test_kanban_core_functionality.py @@ -902,12 +902,13 @@ def test_list_profiles_on_disk(tmp_path, monkeypatch): """list_profiles_on_disk returns directories under ~/.hermes/profiles/ that contain a config.yaml.""" monkeypatch.setattr(Path, "home", lambda: tmp_path) + monkeypatch.delenv("HERMES_HOME", raising=False) profiles = tmp_path / ".hermes" / "profiles" profiles.mkdir(parents=True) - (profiles / "researcher").mkdir() - (profiles / "researcher" / "config.yaml").write_text("model: {}\n") - (profiles / "writer").mkdir() - (profiles / "writer" / "config.yaml").write_text("model: {}\n") + for name in ("researcher", "writer"): + d = profiles / name + d.mkdir() + (d / "config.yaml").write_text("model: {}\n") (profiles / "empty_dir").mkdir() # A stray file; should be ignored. (profiles / "stray.txt").write_text("noise") @@ -916,6 +917,20 @@ def test_list_profiles_on_disk(tmp_path, monkeypatch): assert names == ["researcher", "writer"] +def test_list_profiles_on_disk_custom_root(tmp_path, monkeypatch): + """list_profiles_on_disk respects a custom HERMES_HOME root.""" + monkeypatch.setenv("HERMES_HOME", str(tmp_path)) + profiles = tmp_path / "profiles" + profiles.mkdir(parents=True) + for name in ("researcher", "writer"): + d = profiles / name + d.mkdir() + (d / "config.yaml").write_text("model: {}\n") + + names = kb.list_profiles_on_disk() + assert names == ["researcher", "writer"] + + def test_known_assignees_merges_disk_and_board(tmp_path, monkeypatch): """known_assignees unions profiles on disk with currently-assigned names, and reports per-status counts."""