Fix warnings in tests

This commit is contained in:
grossmj committed 2024-05-09 17:11:12 +07:00
1 parent 3fd44f5260
commit 33499be425
31 files changed
+51 -52

No files matched your search

@@ -55,7 +55,7 @@ async def test_start(gns3vm, controller):
assert gns3vm.password == "world"
async def test_start_invalid_vm(loop, gns3vm, controller):
async def test_start_invalid_vm(event_loop, gns3vm, controller):
await controller.add_compute("r1",
name="R1",
@@ -25,7 +25,7 @@ from gns3server.controller.gns3vm.virtualbox_gns3_vm import VirtualBoxGNS3VM
@pytest.fixture
async def gns3vm(loop, controller):
async def gns3vm(event_loop, controller):
vm = VirtualBoxGNS3VM(controller)
vm.vmname = "GNS3 VM"
@@ -21,7 +21,7 @@ from gns3server.controller.gns3vm.vmware_gns3_vm import VMwareGNS3VM
@pytest.fixture
async def gns3vm(loop, controller):
async def gns3vm(event_loop, controller):
vm = VMwareGNS3VM(controller)
vm.vmname = "GNS3 VM"
+1 -1
View File
@@ -33,7 +33,7 @@ from gns3server.utils.asyncio import aiozipstream
@pytest.fixture
async def project(loop, controller):
async def project(event_loop, controller):
p = Project(controller=controller, name="test")
p.dump = MagicMock()
+3 -3
View File
@@ -47,7 +47,7 @@ def dummy_gns3vm(controller, dummy_engine):
return vm
async def test_list(loop, controller):
async def test_list(event_loop, controller):
vm = GNS3VM(controller)
with asyncio_patch("gns3server.controller.gns3vm.vmware_gns3_vm.VMwareGNS3VM.list", return_value=[{"vmname": "test", "vmx_path": "test"}]):
@@ -60,14 +60,14 @@ async def test_list(loop, controller):
await vm.list("hyperv")
async def test_json(loop, controller):
async def test_json(event_loop, controller):
vm = GNS3VM(controller)
assert vm.__json__() == vm._settings
@pytest.mark.skipif(sys.platform.startswith("win"), reason="Not working well on Windows")
async def test_update_settings(loop, controller):
async def test_update_settings(event_loop, controller):
vm = GNS3VM(controller)
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(loop, linux_platform, tmpdir, controller):
async def test_import_iou_linux_no_vm(event_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(loop, linux_platform, tmpdir, controller):
assert topo["topology"]["nodes"][0]["compute_id"] == "local"
async def test_import_iou_linux_with_vm(loop, linux_platform, tmpdir, controller):
async def test_import_iou_linux_with_vm(event_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(loop, linux_platform, tmpdir, controller
assert topo["topology"]["nodes"][0]["compute_id"] == "vm"
async def test_import_nat_non_linux(loop, windows_platform, tmpdir, controller):
async def test_import_nat_non_linux(event_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(loop, windows_platform, tmpdir, controller):
assert topo["topology"]["nodes"][0]["compute_id"] == "vm"
async def test_import_iou_non_linux(loop, windows_platform, tmpdir, controller):
async def test_import_iou_non_linux(event_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(loop, 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(loop, linux_platform, tmpdir, controller):
async def test_import_node_id(event_loop, linux_platform, tmpdir, controller):
"""
When importing a node, node_id should change
"""
@@ -449,7 +449,7 @@ async def test_import_node_id(loop, 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(loop, windows_platform, tmpdir, controller):
async def test_import_keep_compute_id(event_loop, windows_platform, tmpdir, controller):
"""
On linux host IOU should be moved to the GNS3 VM
"""