mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-25 01:38:08 +00:00
Merge branch '2.2' into 3.0
# Conflicts: # README.md # README.rst # tests/handlers/api/compute/test_nat.py
This commit is contained in:
commit
f09594ae4c
@ -1,4 +1,4 @@
|
|||||||
include README.rst
|
include README.md
|
||||||
include AUTHORS
|
include AUTHORS
|
||||||
include LICENSE
|
include LICENSE
|
||||||
include MANIFEST.in
|
include MANIFEST.in
|
||||||
|
@ -30,6 +30,9 @@ from unittest.mock import patch, MagicMock
|
|||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def fake_qemu_img_binary(tmpdir):
|
def fake_qemu_img_binary(tmpdir):
|
||||||
|
|
||||||
|
if sys.platform.startswith("win"):
|
||||||
|
bin_path = str(tmpdir / "qemu-img.EXE")
|
||||||
|
else:
|
||||||
bin_path = str(tmpdir / "qemu-img")
|
bin_path = str(tmpdir / "qemu-img")
|
||||||
with open(bin_path, "w+") as f:
|
with open(bin_path, "w+") as f:
|
||||||
f.write("1")
|
f.write("1")
|
||||||
|
@ -45,6 +45,9 @@ async def manager(port_manager):
|
|||||||
def fake_qemu_img_binary(monkeypatch, tmpdir):
|
def fake_qemu_img_binary(monkeypatch, tmpdir):
|
||||||
|
|
||||||
monkeypatch.setenv("PATH", str(tmpdir))
|
monkeypatch.setenv("PATH", str(tmpdir))
|
||||||
|
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")
|
bin_path = os.path.join(os.environ["PATH"], "qemu-img")
|
||||||
with open(bin_path, "w+") as f:
|
with open(bin_path, "w+") as f:
|
||||||
f.write("1")
|
f.write("1")
|
||||||
@ -865,6 +868,9 @@ def test_get_qemu_img(vm, tmpdir):
|
|||||||
open(str(tmpdir / "qemu-system-x86_64"), "w+").close()
|
open(str(tmpdir / "qemu-system-x86_64"), "w+").close()
|
||||||
open(str(tmpdir / "qemu-img"), "w+").close()
|
open(str(tmpdir / "qemu-img"), "w+").close()
|
||||||
vm._qemu_path = str(tmpdir / "qemu-system-x86_64")
|
vm._qemu_path = str(tmpdir / "qemu-system-x86_64")
|
||||||
|
if sys.platform.startswith("win"):
|
||||||
|
assert vm._get_qemu_img() == str(tmpdir / "qemu-img.EXE")
|
||||||
|
else:
|
||||||
assert vm._get_qemu_img() == str(tmpdir / "qemu-img")
|
assert vm._get_qemu_img() == str(tmpdir / "qemu-img")
|
||||||
|
|
||||||
|
|
||||||
|
0
tests/handlers/api/compute/test_nat.py
Normal file
0
tests/handlers/api/compute/test_nat.py
Normal file
Loading…
Reference in New Issue
Block a user