mirror of
https://github.com/GNS3/gns3-server
synced 2025-01-12 09:00:57 +00:00
Fix tests with Yarl 0.11
This commit is contained in:
parent
5747aba83c
commit
fd0770158c
@ -136,7 +136,7 @@ def test_get_file(http_compute, tmpdir):
|
||||
assert response.status == 404
|
||||
|
||||
response = http_compute.get("/projects/{project_id}/files/../hello".format(project_id=project.id), raw=True)
|
||||
assert response.status == 403
|
||||
assert response.status == 404
|
||||
|
||||
|
||||
def test_write_file(http_compute, tmpdir):
|
||||
@ -151,7 +151,7 @@ def test_write_file(http_compute, tmpdir):
|
||||
assert f.read() == "world"
|
||||
|
||||
response = http_compute.post("/projects/{project_id}/files/../hello".format(project_id=project.id), raw=True)
|
||||
assert response.status == 403
|
||||
assert response.status == 404
|
||||
|
||||
|
||||
def test_stream_file(http_compute, tmpdir):
|
||||
@ -170,4 +170,4 @@ def test_stream_file(http_compute, tmpdir):
|
||||
assert response.status == 404
|
||||
|
||||
response = http_compute.get("/projects/{project_id}/files/../hello".format(project_id=project.id), raw=True)
|
||||
assert response.status == 403
|
||||
assert response.status == 404
|
||||
|
@ -258,7 +258,7 @@ def test_upload_image_ova(http_compute, tmpdir):
|
||||
def test_upload_image_forbiden_location(http_compute, tmpdir):
|
||||
with patch("gns3server.compute.Qemu.get_images_directory", return_value=str(tmpdir),):
|
||||
response = http_compute.post("/qemu/images/../../test2", body="TEST", raw=True)
|
||||
assert response.status == 403
|
||||
assert response.status == 404
|
||||
|
||||
|
||||
def test_upload_image_permission_denied(http_compute, tmpdir):
|
||||
|
@ -234,7 +234,7 @@ def test_get_file(http_controller, tmpdir, project, node, compute):
|
||||
compute.http_query.assert_called_with("GET", "/projects/{project_id}/files/project-files/vpcs/{node_id}/hello".format(project_id=project.id, node_id=node.id), timeout=None, raw=True)
|
||||
|
||||
response = http_controller.get("/projects/{project_id}/nodes/{node_id}/files/../hello".format(project_id=project.id, node_id=node.id), raw=True)
|
||||
assert response.status == 403
|
||||
assert response.status == 404
|
||||
|
||||
|
||||
def test_post_file(http_controller, tmpdir, project, node, compute):
|
||||
@ -245,4 +245,4 @@ def test_post_file(http_controller, tmpdir, project, node, compute):
|
||||
compute.http_query.assert_called_with("POST", "/projects/{project_id}/files/project-files/vpcs/{node_id}/hello".format(project_id=project.id, node_id=node.id), data=b'hello', timeout=None, raw=True)
|
||||
|
||||
response = http_controller.get("/projects/{project_id}/nodes/{node_id}/files/../hello".format(project_id=project.id, node_id=node.id), raw=True)
|
||||
assert response.status == 403
|
||||
assert response.status == 404
|
||||
|
@ -203,7 +203,7 @@ def test_get_file(http_controller, tmpdir, loop, project):
|
||||
assert response.status == 404
|
||||
|
||||
response = http_controller.get("/projects/{project_id}/files/../hello".format(project_id=project.id), raw=True)
|
||||
assert response.status == 403
|
||||
assert response.status == 404
|
||||
|
||||
|
||||
def test_write_file(http_controller, tmpdir, project):
|
||||
@ -214,7 +214,7 @@ def test_write_file(http_controller, tmpdir, project):
|
||||
assert f.read() == "world"
|
||||
|
||||
response = http_controller.post("/projects/{project_id}/files/../hello".format(project_id=project.id), raw=True)
|
||||
assert response.status == 403
|
||||
assert response.status == 404
|
||||
|
||||
|
||||
def test_write_and_get_file_with_leading_slashes_in_filename(http_controller, tmpdir, loop, project):
|
||||
|
Loading…
Reference in New Issue
Block a user