Ensure we dump a .gns3 before exporting it

Fix #915
This commit is contained in:
Julien Duponchelle 2017-02-27 11:08:58 +01:00
parent 34d0736946
commit 53dd1bd6e1
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8
2 changed files with 6 additions and 1 deletions

View File

@ -47,6 +47,9 @@ def export_project(project, temporary_dir, include_images=False, keep_compute_id
if project.is_running():
raise aiohttp.web.HTTPConflict(text="Running topology could not be exported")
# Make sure we save the project
project.dump()
z = zipstream.ZipFile(allowZip64=True)
if not os.path.exists(project._path):

View File

@ -33,7 +33,9 @@ from gns3server.controller.export_project import export_project, _filter_files
@pytest.fixture
def project(controller):
return Project(controller=controller, name="Test")
p = Project(controller=controller, name="Test")
p.dump = MagicMock()
return p
@pytest.fixture