1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-17 22:08:35 +00:00

Return HTTP status code 204 in API when project successfully closed. Fixes #1689

This commit is contained in:
grossmj 2019-11-11 15:32:57 +08:00
parent a98fc2d308
commit 992c60e3e0
2 changed files with 2 additions and 3 deletions

View File

@ -166,8 +166,7 @@ class ProjectHandler:
controller = Controller.instance()
project = controller.get_project(request.match_info["project_id"])
await project.close()
response.set_status(201)
response.json(project)
response.set_status(204)
@Route.post(
r"/projects/{project_id}/open",

View File

@ -148,7 +148,7 @@ def test_delete_project_invalid_uuid(http_controller):
def test_close_project(http_controller, project):
with asyncio_patch("gns3server.controller.project.Project.close", return_value=True) as mock:
response = http_controller.post("/projects/{project_id}/close".format(project_id=project.id), example=True)
assert response.status == 201
assert response.status == 204
assert mock.called