mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-08-12 15:19:16 +03:00
test(exec): isolate Windows platform mock
This commit is contained in:
@@ -160,7 +160,7 @@ class TestSpawnWindows:
|
|||||||
|
|
||||||
with (
|
with (
|
||||||
patch("nanobot.agent.tools.shell._IS_WINDOWS", True),
|
patch("nanobot.agent.tools.shell._IS_WINDOWS", True),
|
||||||
patch("nanobot.agent.tools.shell.sys.platform", "win32"),
|
patch("nanobot.agent.tools.shell.sys", MagicMock(platform="win32")),
|
||||||
patch("asyncio.create_subprocess_exec", new_callable=AsyncMock) as mock_exec,
|
patch("asyncio.create_subprocess_exec", new_callable=AsyncMock) as mock_exec,
|
||||||
patch.object(ExecTool, "_create_windows_job", return_value=job),
|
patch.object(ExecTool, "_create_windows_job", return_value=job),
|
||||||
pytest.raises(OSError, match="OpenProcess failed"),
|
pytest.raises(OSError, match="OpenProcess failed"),
|
||||||
|
|||||||
Reference in New Issue
Block a user