mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-05 06:41:13 +02:00
4 files changed
+9
-14
No files matched your search
@@ -173,9 +173,9 @@ def test_upload_vm(server, tmpdir):
|
||||
|
||||
|
||||
def test_upload_vm_permission_denied(server, tmpdir):
|
||||
with open(str(tmpdir / "test2"), "w+") as f:
|
||||
with open(str(tmpdir / "test2.tmp"), "w+") as f:
|
||||
f.write("")
|
||||
os.chmod(str(tmpdir / "test2"), 0)
|
||||
os.chmod(str(tmpdir / "test2.tmp"), 0)
|
||||
|
||||
with patch("gns3server.modules.Dynamips.get_images_directory", return_value=str(tmpdir),):
|
||||
response = server.post("/dynamips/vms/test2", body="TEST", raw=True)
|
||||
|
||||
@@ -349,11 +349,3 @@ def test_upload_vm(server, tmpdir):
|
||||
assert checksum == "033bd94b1168d7e4f0d644c3c95e35bf"
|
||||
|
||||
|
||||
def test_upload_vm_permission_denied(server, tmpdir):
|
||||
with open(str(tmpdir / "test2"), "w+") as f:
|
||||
f.write("")
|
||||
os.chmod(str(tmpdir / "test2"), 0)
|
||||
|
||||
with patch("gns3server.modules.IOU.get_images_directory", return_value=str(tmpdir),):
|
||||
response = server.post("/iou/vms/test2", body="TEST", raw=True)
|
||||
assert response.status == 409
|
||||
@@ -263,9 +263,9 @@ def test_upload_vm_forbiden_location(server, tmpdir):
|
||||
|
||||
|
||||
def test_upload_vm_permission_denied(server, tmpdir):
|
||||
with open(str(tmpdir / "test2"), "w+") as f:
|
||||
with open(str(tmpdir / "test2.tmp"), "w+") as f:
|
||||
f.write("")
|
||||
os.chmod(str(tmpdir / "test2"), 0)
|
||||
os.chmod(str(tmpdir / "test2.tmp"), 0)
|
||||
|
||||
with patch("gns3server.modules.Qemu.get_images_directory", return_value=str(tmpdir),):
|
||||
response = server.post("/qemu/vms/test2", body="TEST", raw=True)
|
||||
|
||||
Reference in new issue
Block a user