mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-24 09:18:08 +00:00
Fix tests
This commit is contained in:
parent
78c301653f
commit
e9c95ff299
@ -31,7 +31,10 @@ from unittest.mock import patch, MagicMock
|
||||
@pytest.fixture
|
||||
def fake_qemu_img_binary(tmpdir):
|
||||
|
||||
bin_path = str(tmpdir / "qemu-img")
|
||||
if sys.platform.startswith("win"):
|
||||
bin_path = str(tmpdir / "qemu-img.exe")
|
||||
else:
|
||||
bin_path = str(tmpdir / "qemu-img")
|
||||
with open(bin_path, "w+") as f:
|
||||
f.write("1")
|
||||
os.chmod(bin_path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
|
||||
|
@ -45,7 +45,10 @@ async def manager(loop, port_manager):
|
||||
def fake_qemu_img_binary(monkeypatch, tmpdir):
|
||||
|
||||
monkeypatch.setenv("PATH", str(tmpdir))
|
||||
bin_path = os.path.join(os.environ["PATH"], "qemu-img")
|
||||
if sys.platform.startswith("win"):
|
||||
bin_path = os.path.join(os.environ["PATH"], "qemu-img.exe")
|
||||
else:
|
||||
bin_path = os.path.join(os.environ["PATH"], "qemu-img")
|
||||
with open(bin_path, "w+") as f:
|
||||
f.write("1")
|
||||
os.chmod(bin_path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
|
||||
|
Loading…
Reference in New Issue
Block a user