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:
Julien Duponchelle committed 2016-07-28 15:00:04 +02:00
1 parent 7d90a73ed2
commit d6f63d3b7d
3 files changed
+39 -13

No files matched your search

+14 -1
View File
@@ -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: