From bce9c61e41ec5017370c7274a93e1cb8913cef09 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Wed, 19 Jul 2017 16:02:14 +0200 Subject: [PATCH] Cleanup unused code in test_link --- tests/handlers/api/controller/test_link.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tests/handlers/api/controller/test_link.py b/tests/handlers/api/controller/test_link.py index 1dc86c99..1e3c38b1 100644 --- a/tests/handlers/api/controller/test_link.py +++ b/tests/handlers/api/controller/test_link.py @@ -19,20 +19,16 @@ This test suite check /project endpoint """ -import uuid -import os import asyncio import aiohttp import pytest -from unittest.mock import patch, MagicMock, PropertyMock +from unittest.mock import patch, MagicMock from tests.utils import asyncio_patch, AsyncioMagicMock -from gns3server.handlers.api.controller.project_handler import ProjectHandler from gns3server.controller import Controller from gns3server.controller.ports.ethernet_port import EthernetPort -from gns3server.controller.node import Node from gns3server.controller.link import Link, FILTERS @@ -107,7 +103,7 @@ def test_create_link_failure(http_controller, tmpdir, project, compute, async_ru node1 = async_run(project.add_node(compute, "node1", None, node_type="qemu")) node1._ports = [EthernetPort("E0", 0, 0, 3), EthernetPort("E0", 0, 0, 4)] - with asyncio_patch("gns3server.controller.udp_link.UDPLink.create") as mock: + with asyncio_patch("gns3server.controller.udp_link.UDPLink.create"): response = http_controller.post("/projects/{}/links".format(project.id), { "nodes": [ { @@ -147,7 +143,7 @@ def test_update_link(http_controller, tmpdir, project, compute, async_run): "frequency_drop": [50] } - with asyncio_patch("gns3server.controller.udp_link.UDPLink.create") as mock: + with asyncio_patch("gns3server.controller.udp_link.UDPLink.create"): response = http_controller.post("/projects/{}/links".format(project.id), { "nodes": [ { @@ -220,7 +216,7 @@ def test_list_link(http_controller, tmpdir, project, compute, async_run): "port_number": 4 } ] - with asyncio_patch("gns3server.controller.udp_link.UDPLink.create") as mock: + with asyncio_patch("gns3server.controller.udp_link.UDPLink.create"): response = http_controller.post("/projects/{}/links".format(project.id), { "nodes": nodes, "filters": filters