Manage error when GNS3VM failed to start

Fix https://github.com/GNS3/gns3-gui/issues/1446
This commit is contained in:
Julien Duponchelle committed 2016-09-01 15:36:41 +02:00
1 parent f216422d0f
commit 4bbd8938ab
7 files changed
+101 -12

No files matched your search

+9 -3
View File
@@ -289,7 +289,12 @@ def test_getProject(controller, async_run):
def test_start(controller, async_run):
async_run(controller.start())
controller.gns3vm.settings = {
"enable": False,
"engine": "vmware"
}
with asyncio_patch("gns3server.controller.compute.Compute.connect") as mock:
async_run(controller.start())
assert len(controller.computes) == 1 # Local compute is created
assert controller.computes["local"].name == socket.gethostname()
@@ -303,8 +308,9 @@ def test_start_vm(controller, async_run):
"engine": "vmware"
}
with asyncio_patch("gns3server.controller.gns3vm.vmware_gns3_vm.VMwareGNS3VM.start") as mock:
async_run(controller.start())
assert mock.called
with asyncio_patch("gns3server.controller.compute.Compute.connect") as mock_connect:
async_run(controller.start())
assert mock.called
assert "local" in controller.computes
assert "vm" in controller.computes
assert len(controller.computes) == 2 # Local compute and vm are created