test: fix clink agent tests to mock shutil.which() for executable resolution

The previous commit (f98046c) added shutil.which() to resolve executables,
which broke two tests that only mocked subprocess execution. This commit
adds shutil.which() mocking to both test files to restore test compatibility.

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
christopher-buss
2025-10-07 17:39:41 +01:00
parent f98046c2fc
commit 4370be33b4
2 changed files with 10 additions and 0 deletions

View File

@@ -1,4 +1,5 @@
import asyncio
import shutil
from pathlib import Path
import pytest
@@ -41,7 +42,11 @@ async def _run_agent_with_process(monkeypatch, agent, role, process):
async def fake_create_subprocess_exec(*_args, **_kwargs):
return process
def fake_which(executable_name):
return f"/usr/bin/{executable_name}"
monkeypatch.setattr(asyncio, "create_subprocess_exec", fake_create_subprocess_exec)
monkeypatch.setattr(shutil, "which", fake_which)
return await agent.run(role=role, prompt="do something", files=[], images=[])

View File

@@ -1,4 +1,5 @@
import asyncio
import shutil
from pathlib import Path
import pytest
@@ -41,7 +42,11 @@ async def _run_agent_with_process(monkeypatch, agent, role, process):
async def fake_create_subprocess_exec(*_args, **_kwargs):
return process
def fake_which(executable_name):
return f"/usr/bin/{executable_name}"
monkeypatch.setattr(asyncio, "create_subprocess_exec", fake_create_subprocess_exec)
monkeypatch.setattr(shutil, "which", fake_which)
return await agent.run(role=role, prompt="do something", files=[], images=[])