fix(api): return 200 instead of 201 for ACL endpoints, IOU license update

This commit is contained in:
Mark Paronyan committed 2026-10-07 13:56:08 +03:00
1 parent 2fb7056cb9
commit 97d5480241
8 files changed
+18 -6

No files matched your search

+5
View File
@@ -161,3 +161,8 @@ class TestACLRoutes:
# the ACE should have been deleted after deleting the project
assert not await rbac_repo.get_ace_by_path(path)
async def test_get_endpoints(self, app: FastAPI, client: AsyncClient) -> None:
response = await client.get(app.url_path_for("endpoints"))
assert response.status_code == status.HTTP_200_OK
@@ -70,3 +70,10 @@ class TestControllerRoutes:
response = await client.get(app.url_path_for("statistics"))
assert response.status_code == status.HTTP_200_OK
async def test_update_iou_license(self, app: FastAPI, client: AsyncClient) -> None:
license_settings = {"iourc_content": "[license]\ngns3vm = 1234567890abcdef;", "license_check": False}
response = await client.put(app.url_path_for("update_iou_license"), json=license_settings)
assert response.status_code == status.HTTP_200_OK
assert response.json() == license_settings
+1 -1
View File
@@ -196,7 +196,7 @@ class TestControllerProjectRoutes:
with asyncio_patch("gns3server.controller.project.Project.open", return_value=True) as mock:
response = await client.post(app.url_path_for("open_project", project_id=project.id))
assert response.status_code == status.HTTP_201_CREATED
assert response.status_code == status.HTTP_200_OK
assert mock.called
async def test_load_project(self, app: FastAPI, client: AsyncClient, project: Project, config) -> None:
@@ -72,7 +72,7 @@ class TestSnapshotRoutes:
response = await client.post(
app.url_path_for("restore_snapshot", project_id=project.id, snapshot_id=snapshot.id)
)
assert response.status_code == status.HTTP_201_CREATED
assert response.status_code == status.HTTP_200_OK
assert response.json()["name"] == project.name
async def test_create_snapshot(self, app: FastAPI, client: AsyncClient, project: Project) -> None: