API for duplicate a project

Ref https://github.com/GNS3/gns3-gui/issues/995
This commit is contained in:
Julien Duponchelle committed 2016-07-25 16:26:33 +02:00
1 parent fb3b6b62f5
commit f357879186
9 files changed
+285 -57

No files matched your search

@@ -220,3 +220,10 @@ def test_import(http_controller, tmpdir, controller):
with open(os.path.join(project.path, "demo")) as f:
content = f.read()
assert content == "hello"
def test_duplicate(http_controller, tmpdir, loop, project):
response = http_controller.post("/projects/{project_id}/duplicate".format(project_id=project.id), {"name": "hello"}, example=True)
assert response.status == 201
assert response.json["name"] == "hello"