Fix tests for Windows

This commit is contained in:
grossmj committed 2020-06-16 01:57:16 -07:00
1 parent 1d4c3a164d
commit e4b7e46444
13 files changed
+49 -47

No files matched your search

@@ -21,7 +21,7 @@ from gns3server.controller.gns3vm.vmware_gns3_vm import VMwareGNS3VM
@pytest.fixture
def gns3vm(controller):
async def gns3vm(loop, controller):
vm = VMwareGNS3VM(controller)
vm.vmname = "GNS3 VM"
@@ -34,7 +34,7 @@ def vmx_path(tmpdir):
return str(tmpdir / "vmwware_vm.vmx")
async def test_set_extra_options(loop, gns3vm, vmx_path, windows_platform):
async def test_set_extra_options(gns3vm, vmx_path, windows_platform):
gns3vm._vmx_path = vmx_path
+2 -2
View File
@@ -46,7 +46,7 @@ def dummy_gns3vm(controller, dummy_engine):
return vm
async def test_list(controller):
async def test_list(loop, controller):
vm = GNS3VM(controller)
with asyncio_patch("gns3server.controller.gns3vm.vmware_gns3_vm.VMwareGNS3VM.list", return_value=[{"vmname": "test", "vmx_path": "test"}]):
@@ -59,7 +59,7 @@ async def test_list(controller):
await vm.list("hyperv")
def test_json(controller):
async def test_json(controller):
vm = GNS3VM(controller)
assert vm.__json__() == vm._settings
+6 -6
View File
@@ -166,7 +166,7 @@ async def test_import_with_images(tmpdir, controller):
assert os.path.exists(path), path
async def test_import_iou_linux_no_vm(linux_platform, tmpdir, controller):
async def test_import_iou_linux_no_vm(loop, linux_platform, tmpdir, controller):
"""
On non linux host IOU should be local if we don't have a GNS3 VM
"""
@@ -210,7 +210,7 @@ async def test_import_iou_linux_no_vm(linux_platform, tmpdir, controller):
assert topo["topology"]["nodes"][0]["compute_id"] == "local"
async def test_import_iou_linux_with_vm(linux_platform, tmpdir, controller):
async def test_import_iou_linux_with_vm(loop, linux_platform, tmpdir, controller):
"""
On non linux host IOU should be vm if we have a GNS3 VM configured
"""
@@ -255,7 +255,7 @@ async def test_import_iou_linux_with_vm(linux_platform, tmpdir, controller):
assert topo["topology"]["nodes"][0]["compute_id"] == "vm"
async def test_import_nat_non_linux(windows_platform, tmpdir, controller):
async def test_import_nat_non_linux(loop, windows_platform, tmpdir, controller):
"""
On non linux host NAT should be moved to the GNS3 VM
"""
@@ -300,7 +300,7 @@ async def test_import_nat_non_linux(windows_platform, tmpdir, controller):
assert topo["topology"]["nodes"][0]["compute_id"] == "vm"
async def test_import_iou_non_linux(windows_platform, tmpdir, controller):
async def test_import_iou_non_linux(loop, windows_platform, tmpdir, controller):
"""
On non linux host IOU should be moved to the GNS3 VM
"""
@@ -356,7 +356,7 @@ async def test_import_iou_non_linux(windows_platform, tmpdir, controller):
mock.assert_called_with(controller._computes["vm"], project_id, project.path, os.path.join('project-files', 'iou', topo["topology"]["nodes"][0]['node_id']))
async def test_import_node_id(linux_platform, tmpdir, controller):
async def test_import_node_id(loop, linux_platform, tmpdir, controller):
"""
When importing a node, node_id should change
"""
@@ -449,7 +449,7 @@ async def test_import_node_id(linux_platform, tmpdir, controller):
assert os.path.exists(os.path.join(project.path, "project-files", "iou", topo["topology"]["nodes"][0]["node_id"], "startup.cfg"))
async def test_import_keep_compute_id(windows_platform, tmpdir, controller):
async def test_import_keep_compute_id(loop, windows_platform, tmpdir, controller):
"""
On linux host IOU should be moved to the GNS3 VM
"""
+1 -1
View File
@@ -101,7 +101,7 @@ def test_empty_properties(compute, project):
assert "category" not in node.properties # Controller only
def test_eq(compute, project, node, controller):
async def test_eq(compute, project, node, controller):
assert node == Node(project, compute, "demo1", node_id=node.id, node_type="qemu")
assert node != "a"