Fix tests

This commit is contained in:
grossmj 2026-02-20 15:50:25 +08:00
parent bc1729b255
commit 715b7032bc
No known key found for this signature in database
GPG Key ID: 1E7DD6DBB53FF3D7

View File

@ -251,7 +251,7 @@ async def test_install_busybox_dynamic_linked():
mock_process.communicate = AsyncioMagicMock(return_value=(b"Dynamically linked library", b""))
with patch("os.path.isfile", return_value=False):
with patch("gns3server.compute.docker.shutil.which", return_value="/usr/bin/busybox"):
with patch("gns3server.compute.docker.shutil.which", side_effect=lambda name: "/usr/bin/busybox" if name == "busybox" else None):
with asyncio_patch("gns3server.compute.docker.asyncio.create_subprocess_exec", return_value=mock_process):
with pytest.raises(DockerError) as e:
dst_dir = Docker.resources_path()