Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions packages/claude-code-plugin/tests/test_hud.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,14 @@ def test_no_content_with_blockers_returns_empty(self):


class TestIntegration:
# Isolate HUD state so tests don't read the real session file.
# Without this, select_face_from_state picks up the live session's
# mode (e.g. PLAN → ◔‿◔) instead of returning the idle face (◕‿◕).
_ISOLATED_ENV = {
**os.environ,
"CODINGBUDDY_HUD_STATE_FILE": "/tmp/_test_hud_nonexistent_state.json",
}

def test_pipe_stdin(self):
"""Run the script as a subprocess with piped stdin."""
script = os.path.join(_hooks_dir, "codingbuddy-hud.py")
Expand All @@ -766,6 +774,7 @@ def test_pipe_stdin(self):
input=stdin_data,
capture_output=True,
text=True,
env=self._ISOLATED_ENV,
)
assert result.returncode == 0
assert "\u25d5\u203f\u25d5" in result.stdout # ◕‿◕
Expand Down Expand Up @@ -793,6 +802,7 @@ def test_pipe_stdin_estimated_cost(self):
input=stdin_data,
capture_output=True,
text=True,
env=self._ISOLATED_ENV,
)
assert result.returncode == 0
assert "~$" in result.stdout
Expand All @@ -805,6 +815,7 @@ def test_empty_stdin_fallback(self):
input="",
capture_output=True,
text=True,
env=self._ISOLATED_ENV,
)
assert result.returncode == 0
assert "\u25d5\u203f\u25d5" in result.stdout
Expand Down
Loading