mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
fix: tests after merging
This commit is contained in:
4 files changed
+7
-5
No files matched your search
@@ -1883,7 +1883,7 @@ async def test_memory(compute_project, manager):
|
||||
})
|
||||
assert vm._cid == "e90e34656806"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_stop_exited_container_no_stop_query(vm):
|
||||
|
||||
vm._ubridge_hypervisor = None
|
||||
|
||||
@@ -21,7 +21,6 @@ import uuid
|
||||
import json
|
||||
import zipfile
|
||||
import pytest
|
||||
import aiohttp
|
||||
|
||||
from pathlib import Path
|
||||
from tests.utils import asyncio_patch, AsyncioMagicMock
|
||||
@@ -29,6 +28,7 @@ from unittest.mock import patch, MagicMock
|
||||
|
||||
from gns3server.utils.asyncio import aiozipstream
|
||||
from gns3server.controller.project import Project
|
||||
from gns3server.controller.controller_error import ControllerError
|
||||
from gns3server.controller.export_project import export_project
|
||||
from gns3server.controller.import_project import import_project, _move_files_to_compute
|
||||
from gns3server.version import __version__
|
||||
@@ -189,11 +189,12 @@ async def test_import_project_containing_absolute_symlink(controller, export_pro
|
||||
symlink_target = "/tmp/anywhere"
|
||||
zip_path = await export_project_with_symlink(symlink_target)
|
||||
|
||||
with pytest.raises(aiohttp.web.HTTPConflict):
|
||||
with pytest.raises(ControllerError):
|
||||
with open(zip_path, "rb") as f:
|
||||
await import_project(controller, project_id, f)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_import_project_containing_escaping_symlink(controller, export_project_with_symlink):
|
||||
"""
|
||||
Test importing a project containing a symlink that escapes the project directory.
|
||||
@@ -204,11 +205,12 @@ async def test_import_project_containing_escaping_symlink(controller, export_pro
|
||||
symlink_target = "../../../../symlink_target"
|
||||
zip_path = await export_project_with_symlink(symlink_target)
|
||||
|
||||
with pytest.raises(aiohttp.web.HTTPConflict):
|
||||
with pytest.raises(ControllerError):
|
||||
with open(zip_path, "rb") as f:
|
||||
await import_project(controller, project_id, f)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_import_upgrade(tmpdir, controller):
|
||||
"""
|
||||
Topology made for previous GNS3 version are upgraded during the process
|
||||
|
||||
@@ -713,6 +713,7 @@ async def test_delete_does_not_start_nodes(project):
|
||||
assert not project.start_all.called
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_dump(projects_dir):
|
||||
|
||||
directory = projects_dir
|
||||
|
||||
Reference in new issue
Block a user