mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 22:11:14 +02:00
Fixes #1068 - handle zipfile encoding issues at project duplication
This commit is contained in:
1 parent
5c0d955156
commit
64a852f38f
2 files changed
+11
-1
No files matched your search
@@ -23,6 +23,7 @@ import json
|
||||
import pytest
|
||||
import aiohttp
|
||||
import zipfile
|
||||
import zipstream
|
||||
from unittest.mock import MagicMock
|
||||
from tests.utils import AsyncioMagicMock, asyncio_patch
|
||||
from unittest.mock import patch
|
||||
@@ -439,6 +440,15 @@ def test_duplicate(project, async_run, controller):
|
||||
assert list(new_project.nodes.values())[1].compute.id == "remote"
|
||||
|
||||
|
||||
def test_duplicate_with_zipfile_encoding_issues(project, async_run, controller):
|
||||
zf = zipstream.ZipFile()
|
||||
zf.writestr('test\udcc3', "data")
|
||||
|
||||
with asyncio_patch('gns3server.controller.project.export_project', return_value=zf):
|
||||
with pytest.raises(aiohttp.web.HTTPConflict):
|
||||
async_run(project.duplicate(name="Hello"))
|
||||
|
||||
|
||||
def test_snapshots(project):
|
||||
"""
|
||||
List the snapshots
|
||||
|
||||
Reference in new issue
Block a user