mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 22:11:14 +02:00
Fix Exporting portable projects with QEMU includes base images even when selecting no.
Fix https://github.com/GNS3/gns3-gui/issues/1409
This commit is contained in:
3 files changed
+39
-13
No files matched your search
@@ -25,7 +25,7 @@ import asyncio
|
||||
import aiohttp
|
||||
import zipfile
|
||||
|
||||
from unittest.mock import patch
|
||||
from unittest.mock import patch, MagicMock
|
||||
from tests.utils import asyncio_patch
|
||||
|
||||
from gns3server.handlers.api.project_handler import ProjectHandler
|
||||
@@ -306,6 +306,19 @@ def test_export(server, tmpdir, loop, project):
|
||||
assert content == b"hello"
|
||||
|
||||
|
||||
def test_export_include_image(server, tmpdir, loop, project):
|
||||
|
||||
project.export = MagicMock()
|
||||
response = server.get("/projects/{project_id}/export".format(project_id=project.id), raw=True)
|
||||
project.export.assert_called_with(include_images=False)
|
||||
|
||||
response = server.get("/projects/{project_id}/export?include_images=0".format(project_id=project.id), raw=True)
|
||||
project.export.assert_called_with(include_images=False)
|
||||
|
||||
response = server.get("/projects/{project_id}/export?include_images=1".format(project_id=project.id), raw=True)
|
||||
project.export.assert_called_with(include_images=True)
|
||||
|
||||
|
||||
def test_import(server, tmpdir, loop, project):
|
||||
|
||||
with zipfile.ZipFile(str(tmpdir / "test.zip"), 'w') as myzip:
|
||||
|
||||
Reference in new issue
Block a user