Clean action runtime project state

This commit is contained in:
2026-05-14 13:58:45 +03:00
parent b05d3589b7
commit 4ce98d0ff1
27 changed files with 711 additions and 4772 deletions

View File

@@ -2,7 +2,8 @@
import subprocess
from flow.app.completion import complete
from flow.app.completion import complete, install_zsh_completion
from flow.core import paths
from flow.core.config import AppConfig, FlowContext
from flow.core.console import Console
from flow.core.platform import PlatformInfo
@@ -96,3 +97,20 @@ def test_complete_dev_attach_returns_empty_on_timeout():
ctx.runtime.containers.ps = fake_ps # type: ignore[method-assign]
result = complete(ctx, ["flow", "dev", "attach", ""], 3)
assert result == []
def test_install_zsh_completion_uses_action_runtime(tmp_path, monkeypatch):
monkeypatch.setattr(paths, "HOME", tmp_path)
monkeypatch.setattr(paths, "STATE_DIR", tmp_path / "state")
ctx = _make_ctx()
completion_file = install_zsh_completion(
ctx,
directory=str(tmp_path / "completions"),
rc=str(tmp_path / ".zshrc"),
)
assert completion_file == tmp_path / "completions" / "_flow"
assert "compdef _flow flow" in completion_file.read_text()
assert "# >>> flow completion >>>" in (tmp_path / ".zshrc").read_text()
assert (tmp_path / "state" / "actions.jsonl").exists()