From ff7f014423f1b2ebacb2ac133c5b363500f56d37 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Mon, 16 Feb 2015 19:14:45 +0100 Subject: [PATCH] Fix test --- tests/modules/iou/test_iou_vm.py | 4 ++-- tests/modules/vpcs/test_vpcs_vm.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/modules/iou/test_iou_vm.py b/tests/modules/iou/test_iou_vm.py index 46aed183..0ef6ed98 100644 --- a/tests/modules/iou/test_iou_vm.py +++ b/tests/modules/iou/test_iou_vm.py @@ -142,12 +142,12 @@ def test_reload(loop, vm, fake_iou_bin): process.terminate.assert_called_with() -def test_close(vm, port_manager): +def test_close(vm, port_manager, loop): with asyncio_patch("gns3server.modules.iou.iou_vm.IOUVM._check_requirements", return_value=True): with asyncio_patch("asyncio.create_subprocess_exec", return_value=MagicMock()): vm.start() port = vm.console - vm.close() + loop.run_until_complete(asyncio.async(vm.close())) # Raise an exception if the port is not free port_manager.reserve_console_port(port) assert vm.is_running() is False diff --git a/tests/modules/vpcs/test_vpcs_vm.py b/tests/modules/vpcs/test_vpcs_vm.py index 01b77e12..990a386e 100644 --- a/tests/modules/vpcs/test_vpcs_vm.py +++ b/tests/modules/vpcs/test_vpcs_vm.py @@ -212,12 +212,12 @@ def test_change_name(vm, tmpdir): assert f.read() == "name hello" -def test_close(vm, port_manager): +def test_close(vm, port_manager, loop): with asyncio_patch("gns3server.modules.vpcs.vpcs_vm.VPCSVM._check_requirements", return_value=True): with asyncio_patch("asyncio.create_subprocess_exec", return_value=MagicMock()): vm.start() port = vm.console - vm.close() + loop.run_until_complete(asyncio.async(vm.close())) # Raise an exception if the port is not free port_manager.reserve_console_port(port) assert vm.is_running() is False