Fix tests

(cherry picked from commit 2ba6eac113)
This commit is contained in:
grossmj authored and Bernhard Ehlers committed 2020-08-13 17:10:31 +09:30
1 parent 9acb2ceda1
commit c684c554bf
4 files changed
+17 -17

No files matched your search

+1
View File
@@ -337,6 +337,7 @@ def test_set_qemu_path_kvm_binary(vm, fake_qemu_binary):
async def test_set_platform(compute_project, manager):
manager.config_disk = None # avoids conflict with config.img support
with patch("shutil.which", return_value="/bin/qemu-system-x86_64") as which_mock:
with patch("gns3server.compute.qemu.QemuVM._check_qemu_path"):
vm = QemuVM("test", "00010203-0405-0607-0809-0a0b0c0d0e0f", compute_project, manager, platform="x86_64")
+2 -1
View File
@@ -18,7 +18,7 @@
import uuid
import os
import pytest
from unittest.mock import patch
from unittest.mock import patch, MagicMock
from tests.utils import asyncio_patch
from gns3server.compute.vpcs import VPCS
@@ -41,6 +41,7 @@ async def vpcs(loop, port_manager):
async def qemu(loop, port_manager):
Qemu._instance = None
Qemu._init_config_disk = MagicMock() # do not create the config.img image
qemu = Qemu.instance()
qemu.port_manager = port_manager
return qemu