mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Move to version 3 of the REST API.
Rename packet capture endpoints.
This commit is contained in:
1 parent
eeaf10b418
commit
359f9a7384
34 files changed
+120
-118
No files matched your search
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user