1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-30 20:28:08 +00:00

Fix test on Linux

Fix #258
This commit is contained in:
Julien Duponchelle 2015-07-09 15:37:30 +02:00
parent 2fc63601bf
commit dd6c377b15

View File

@ -329,7 +329,6 @@ def test_control_vm_expect_text(vm, loop, running_subprocess_mock):
def test_build_command(vm, loop, fake_qemu_binary, port_manager): def test_build_command(vm, loop, fake_qemu_binary, port_manager):
os.environ["DISPLAY"] = "0:0" os.environ["DISPLAY"] = "0:0"
vm.kvm = False
with asyncio_patch("asyncio.create_subprocess_exec", return_value=MagicMock()) as process: with asyncio_patch("asyncio.create_subprocess_exec", return_value=MagicMock()) as process:
cmd = loop.run_until_complete(asyncio.async(vm._build_command())) cmd = loop.run_until_complete(asyncio.async(vm._build_command()))
assert cmd == [ assert cmd == [
@ -349,17 +348,6 @@ def test_build_command(vm, loop, fake_qemu_binary, port_manager):
] ]
def test_build_command_with_kvm(vm, loop, fake_qemu_binary):
vm.kvm = True
with asyncio_patch("asyncio.create_subprocess_exec", return_value=MagicMock()) as process:
cmd = loop.run_until_complete(asyncio.async(vm._build_command()))
if sys.platform.startswith("linux"):
assert "-enable-kvm" in cmd
else:
assert "-enable-kvm" not in cmd
@pytest.mark.skipif(sys.platform.startswith("win"), reason="Not supported on Windows") @pytest.mark.skipif(sys.platform.startswith("win"), reason="Not supported on Windows")
def test_build_command_without_display(vm, loop, fake_qemu_binary): def test_build_command_without_display(vm, loop, fake_qemu_binary):