feat(exec): add path prepend config
This commit is contained in:
@@ -45,6 +45,28 @@ async def test_exec_path_append_preserves_system_path():
|
||||
assert "Exit code: 0" in result
|
||||
|
||||
|
||||
@_UNIX_ONLY
|
||||
@pytest.mark.asyncio
|
||||
async def test_exec_path_prepend_takes_lookup_precedence(tmp_path):
|
||||
"""pathPrepend should win over pathAppend for executable lookup."""
|
||||
preferred = tmp_path / "preferred"
|
||||
fallback = tmp_path / "fallback"
|
||||
preferred.mkdir()
|
||||
fallback.mkdir()
|
||||
preferred_tool = preferred / "pathprobe"
|
||||
fallback_tool = fallback / "pathprobe"
|
||||
preferred_tool.write_text("#!/bin/sh\necho preferred\n", encoding="utf-8")
|
||||
fallback_tool.write_text("#!/bin/sh\necho fallback\n", encoding="utf-8")
|
||||
preferred_tool.chmod(0o755)
|
||||
fallback_tool.chmod(0o755)
|
||||
|
||||
tool = ExecTool(path_prepend=str(preferred), path_append=str(fallback))
|
||||
result = await tool.execute(command="pathprobe")
|
||||
|
||||
assert "preferred" in result
|
||||
assert "fallback" not in result
|
||||
|
||||
|
||||
@_UNIX_ONLY
|
||||
@pytest.mark.asyncio
|
||||
async def test_exec_allowed_env_keys_passthrough(monkeypatch):
|
||||
|
||||
Reference in New Issue
Block a user