From 74bf6eef0491d50a6de71dcbbd3bf9c597644608 Mon Sep 17 00:00:00 2001 From: AIOSAI Date: Sat, 18 Jul 2026 15:55:23 -0700 Subject: [PATCH] =?UTF-8?q?fix(hooks):=20make=20test=5Fno=5Faipass=5Fdir?= =?UTF-8?q?=5Fis=5Fdisabled=20hermetic=20=E2=80=94=20the=20.aipass=20walk?= =?UTF-8?q?=20climbs=20to=20the=20drive=20root,=20so=20a=20real=20.aipass?= =?UTF-8?q?=20in=20any=20ancestor=20(windows-setup=20runner=20installs=20A?= =?UTF-8?q?IPass=20into=20the=20runner=20home,=20an=20ancestor=20of=20pyte?= =?UTF-8?q?st=20tmp)=20leaked=20into=20the=20no-dir=20case.=20Patch=20=5Ff?= =?UTF-8?q?ind=5Faipass=5Fdir=20to=20None=20for=20that=20branch;=20the=20w?= =?UTF-8?q?alk=20itself=20stays=20covered=20by=20the=20sibling=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/aipass/hooks/tests/test_feedback_pulse.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/aipass/hooks/tests/test_feedback_pulse.py b/src/aipass/hooks/tests/test_feedback_pulse.py index b635a43d..9de105cb 100644 --- a/src/aipass/hooks/tests/test_feedback_pulse.py +++ b/src/aipass/hooks/tests/test_feedback_pulse.py @@ -190,9 +190,13 @@ class TestFeedbackPulseToggle: """Tests for the _is_disabled toggle and sentinel file.""" def test_no_aipass_dir_is_disabled(self, tmp_path): - from aipass.hooks.apps.handlers.prompt.feedback_pulse import _is_disabled + from aipass.hooks.apps.handlers.prompt import feedback_pulse - assert _is_disabled(str(tmp_path)) is True + # The walk climbs to the drive root, so a real .aipass in any ancestor + # (e.g. the CI runner's home after windows-setup installs AIPass) leaks + # into the result — the no-dir case is only constructible by patching. + with patch.object(feedback_pulse, "_find_aipass_dir", return_value=None): + assert feedback_pulse._is_disabled(str(tmp_path)) is True def test_aipass_dir_no_sentinel_is_enabled(self, tmp_path): (tmp_path / ".aipass").mkdir()