1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-15 21:08:55 +00:00
This commit is contained in:
Julien Duponchelle 2015-02-16 19:14:45 +01:00
parent 018e3c1451
commit ff7f014423
2 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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