Move to version 3 of the REST API.

Rename packet capture endpoints.
This commit is contained in:
grossmj committed 2020-11-02 12:05:32 +10:30
1 parent eeaf10b418
commit 359f9a7384
34 files changed
+120 -118

No files matched your search

+2 -2
View File
@@ -322,7 +322,7 @@ async def test_start_capture(controller_api, project):
link = Link(project)
project._links = {link.id: link}
with asyncio_patch("gns3server.controller.link.Link.start_capture") as mock:
response = await controller_api.post("/projects/{}/links/{}/start_capture".format(project.id, link.id))
response = await controller_api.post("/projects/{}/links/{}/capture/start".format(project.id, link.id))
assert mock.called
assert response.status_code == 201
@@ -333,7 +333,7 @@ async def test_stop_capture(controller_api, project):
link = Link(project)
project._links = {link.id: link}
with asyncio_patch("gns3server.controller.link.Link.stop_capture") as mock:
response = await controller_api.post("/projects/{}/links/{}/stop_capture".format(project.id, link.id))
response = await controller_api.post("/projects/{}/links/{}/capture/stop".format(project.id, link.id))
assert mock.called
assert response.status_code == 204
+3 -2
View File
@@ -18,6 +18,7 @@
import pytest
import uuid
from pathlib import Path
from tests.utils import asyncio_patch
from gns3server.controller.template import Template
@@ -593,7 +594,7 @@ async def test_iou_template_create(controller_api):
params = {"name": "IOU template",
"compute_id": "local",
"path": "/path/to/i86bi_linux-ipbase-ms-12.4.bin",
"path": str(Path("/path/to/i86bi_linux-ipbase-ms-12.4.bin")),
"template_type": "iou"}
response = await controller_api.post("/templates", params)
@@ -724,7 +725,7 @@ async def test_vmware_template_create(controller_api):
params = {"name": "VMware template",
"compute_id": "local",
"template_type": "vmware",
"vmx_path": "/path/to/vm.vmx"}
"vmx_path": str(Path("/path/to/vm.vmx"))}
response = await controller_api.post("/templates", params)
assert response.status_code == 201