mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Get a stable example between tests for project creation
This commit is contained in:
1 parent
78237e9fb6
commit
531265eced
2 files changed
+21
-12
No files matched your search
@@ -26,20 +26,28 @@ from gns3server.version import __version__
|
||||
|
||||
|
||||
def test_create_project_with_dir(server, tmpdir):
|
||||
response = server.post('/project', {"location": str(tmpdir)}, example=True)
|
||||
response = server.post("/project", {"location": str(tmpdir)})
|
||||
assert response.status == 200
|
||||
assert response.json['location'] == str(tmpdir)
|
||||
assert response.json["location"] == str(tmpdir)
|
||||
|
||||
|
||||
def test_create_project_without_dir(server):
|
||||
query = {}
|
||||
response = server.post('/project', query)
|
||||
response = server.post("/project", query)
|
||||
assert response.status == 200
|
||||
assert response.json['uuid'] is not None
|
||||
assert response.json["uuid"] is not None
|
||||
|
||||
|
||||
def test_create_project_with_uuid(server):
|
||||
query = {'uuid': '00010203-0405-0607-0809-0a0b0c0d0e0f'}
|
||||
response = server.post('/project', query)
|
||||
query = {"uuid": "00010203-0405-0607-0809-0a0b0c0d0e0f"}
|
||||
response = server.post("/project", query)
|
||||
assert response.status == 200
|
||||
assert response.json['uuid'] is not None
|
||||
assert response.json["uuid"] == "00010203-0405-0607-0809-0a0b0c0d0e0f"
|
||||
|
||||
def test_create_project_with_uuid(server):
|
||||
query = {"uuid": "00010203-0405-0607-0809-0a0b0c0d0e0f", "location": "/tmp"}
|
||||
response = server.post("/project", query, example=True)
|
||||
assert response.status == 200
|
||||
assert response.json["uuid"] == "00010203-0405-0607-0809-0a0b0c0d0e0f"
|
||||
assert response.json["location"] == "/tmp"
|
||||
|
||||
Reference in new issue
Block a user