mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Support to reset links. Fixes https://github.com/GNS3/gns3-server/issues/1620
This commit is contained in:
1 parent
cbcdaabcce
commit
f97d346c34
4 files changed
+51
-2
No files matched your search
@@ -22,6 +22,7 @@ from tests.utils import asyncio_patch, AsyncioMagicMock
|
||||
|
||||
from gns3server.controller.ports.ethernet_port import EthernetPort
|
||||
from gns3server.controller.link import Link, FILTERS
|
||||
from gns3server.controller.udp_link import UDPLink
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -295,6 +296,18 @@ async def test_list_link(controller_api, project, nodes):
|
||||
assert response.json[0]["filters"] == filters
|
||||
|
||||
|
||||
async def test_reset_link(controller_api, project):
|
||||
|
||||
link = UDPLink(project)
|
||||
project._links = {link.id: link}
|
||||
with asyncio_patch("gns3server.controller.udp_link.UDPLink.delete") as delete_mock:
|
||||
with asyncio_patch("gns3server.controller.udp_link.UDPLink.create") as create_mock:
|
||||
response = await controller_api.post("/projects/{}/links/{}/reset".format(project.id, link.id))
|
||||
assert delete_mock.called
|
||||
assert create_mock.called
|
||||
assert response.status == 201
|
||||
|
||||
|
||||
async def test_start_capture(controller_api, project):
|
||||
|
||||
link = Link(project)
|
||||
|
||||
Reference in new issue
Block a user