From 47abba3c9c1f6ec2a41fef9df49142e31b6f31fe Mon Sep 17 00:00:00 2001 From: grossmj Date: Mon, 14 Sep 2015 15:16:54 -0600 Subject: [PATCH] Fixes tests. --- tests/handlers/api/test_iou.py | 2 +- tests/handlers/api/test_vpcs.py | 2 +- tests/modules/qemu/test_qemu_vm.py | 2 +- tests/modules/vpcs/test_vpcs_vm.py | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/handlers/api/test_iou.py b/tests/handlers/api/test_iou.py index 94612a03..d97452b5 100644 --- a/tests/handlers/api/test_iou.py +++ b/tests/handlers/api/test_iou.py @@ -241,7 +241,7 @@ def test_iou_nio_create_ethernet_different_port(server, vm, ethernet_device): def test_iou_nio_create_tap(server, vm, ethernet_device): - with patch("gns3server.modules.base_manager.BaseManager._has_privileged_access", return_value=True): + with patch("gns3server.modules.base_manager.BaseManager.has_privileged_access", return_value=True): response = server.post("/projects/{project_id}/iou/vms/{vm_id}/adapters/1/ports/0/nio".format(project_id=vm["project_id"], vm_id=vm["vm_id"]), {"type": "nio_tap", "tap_device": ethernet_device}) assert response.status == 201 diff --git a/tests/handlers/api/test_vpcs.py b/tests/handlers/api/test_vpcs.py index dc93d565..3f96794d 100644 --- a/tests/handlers/api/test_vpcs.py +++ b/tests/handlers/api/test_vpcs.py @@ -77,7 +77,7 @@ def test_vpcs_nio_create_udp(server, vm): def test_vpcs_nio_create_tap(server, vm, ethernet_device): - with patch("gns3server.modules.base_manager.BaseManager._has_privileged_access", return_value=True): + with patch("gns3server.modules.base_manager.BaseManager.has_privileged_access", return_value=True): response = server.post("/projects/{project_id}/vpcs/vms/{vm_id}/adapters/0/ports/0/nio".format(project_id=vm["project_id"], vm_id=vm["vm_id"]), {"type": "nio_tap", "tap_device": ethernet_device}) assert response.status == 201 diff --git a/tests/modules/qemu/test_qemu_vm.py b/tests/modules/qemu/test_qemu_vm.py index 2525fb71..f42ca403 100644 --- a/tests/modules/qemu/test_qemu_vm.py +++ b/tests/modules/qemu/test_qemu_vm.py @@ -176,7 +176,7 @@ def test_add_nio_binding_udp(vm, loop): def test_add_nio_binding_ethernet(vm, loop, ethernet_device): - with patch("gns3server.modules.base_manager.BaseManager._has_privileged_access", return_value=True): + with patch("gns3server.modules.base_manager.BaseManager.has_privileged_access", return_value=True): nio = Qemu.instance().create_nio(vm.qemu_path, {"type": "nio_generic_ethernet", "ethernet_device": ethernet_device}) loop.run_until_complete(asyncio.async(vm.adapter_add_nio_binding(0, nio))) assert nio.ethernet_device == ethernet_device diff --git a/tests/modules/vpcs/test_vpcs_vm.py b/tests/modules/vpcs/test_vpcs_vm.py index 0fb269c5..e02d7f4d 100644 --- a/tests/modules/vpcs/test_vpcs_vm.py +++ b/tests/modules/vpcs/test_vpcs_vm.py @@ -151,14 +151,14 @@ def test_add_nio_binding_udp(vm): def test_add_nio_binding_tap(vm, ethernet_device): - with patch("gns3server.modules.base_manager.BaseManager._has_privileged_access", return_value=True): + with patch("gns3server.modules.base_manager.BaseManager.has_privileged_access", return_value=True): nio = VPCS.instance().create_nio(vm.vpcs_path, {"type": "nio_tap", "tap_device": ethernet_device}) vm.port_add_nio_binding(0, nio) assert nio.tap_device == ethernet_device # def test_add_nio_binding_tap_no_privileged_access(vm): -# with patch("gns3server.modules.base_manager.BaseManager._has_privileged_access", return_value=False): +# with patch("gns3server.modules.base_manager.BaseManager.has_privileged_access", return_value=False): # with pytest.raises(aiohttp.web.HTTPForbidden): # nio = VPCS.instance().create_nio(vm.vpcs_path, {"type": "nio_tap", "tap_device": "test"}) # vm.port_add_nio_binding(0, nio)