Allow packing to ZIP files

This commit is contained in:
Sybren A. Stüvel
2018-03-22 10:06:48 +01:00
parent e53470d898
commit 8d1bd89583
6 changed files with 118 additions and 13 deletions
Binary file not shown.
+18
View File
@@ -0,0 +1,18 @@
import zipfile
from test_pack import AbstractPackTest
from blender_asset_tracer.pack import zipped
class ZippedPackTest(AbstractPackTest):
def test_basic_file(self):
infile = self.blendfiles / 'basic_file_ñønæščii.blend'
zippath = self.tpath / 'target.zip'
with zipped.ZipPacker(infile, infile.parent, zippath) as packer:
packer.strategise()
packer.execute()
self.assertTrue(zippath.exists())
with zipfile.ZipFile(str(zippath)) as inzip:
inzip.testzip()
self.assertEqual({'pack-info.txt', 'basic_file_ñønæščii.blend'}, set(inzip.namelist()))