From 55266997e77c9ae0bd0424a40d3e11665f9dfdbe Mon Sep 17 00:00:00 2001 From: teknium1 <127238744+teknium1@users.noreply.github.com> Date: Mon, 14 Sep 2026 18:47:21 -0700 Subject: [PATCH] test(config_home): drop the unavailable-parent-link case already covered by the existing diagnostics test test_unavailable_directory_links_are_diagnosed_without_creating_targets already proves a link with a missing target is refused, not materialized; keep the two new invariants (aliased parent -> 0o700; operator link at the home boundary still owns its mode). --- .../test_home_directory_diagnostics.py | 23 ------------------- 1 file changed, 23 deletions(-) diff --git a/tests/hermes_cli/test_home_directory_diagnostics.py b/tests/hermes_cli/test_home_directory_diagnostics.py index cb26ee4d11..15c16e09f3 100644 --- a/tests/hermes_cli/test_home_directory_diagnostics.py +++ b/tests/hermes_cli/test_home_directory_diagnostics.py @@ -127,26 +127,3 @@ def test_aliased_parent_still_leaves_an_operator_home_link_alone(tmp_path, monke assert home.is_symlink() and home.readlink() == shared assert stat.S_IMODE(shared.stat().st_mode) == 0o750 assert stat.S_IMODE((shared / "curator").stat().st_mode) == 0o750 - - -@pytest.mark.linux_only -def test_unavailable_symlinked_parent_is_still_diagnosed(tmp_path, monkeypatch): - """A link above the home with a missing target is still refused instead of materialized.""" - from hermes_cli.config_home import HomeInitializationError - - real_root = tmp_path / "real" - real_root.mkdir() - missing = tmp_path / "unmounted" - alias = real_root / "alias" - alias.symlink_to(missing, target_is_directory=True) - home = alias / "hermes" - - monkeypatch.setattr(config, "get_hermes_home", lambda: home) - monkeypatch.setattr(config, "is_managed", lambda: False) - config._HERMES_HOME_ENSURED.discard(str(home)) - - with pytest.raises(HomeInitializationError): - config.ensure_hermes_home() - - assert alias.is_symlink() and alias.readlink() == missing - assert not missing.exists()