diff options
author | ben | 2018-09-18 10:52:38 +0200 |
---|---|---|
committer | ben | 2018-09-18 10:52:38 +0200 |
commit | f57654b84b4cf0ffa1287034fc9f66ba200bb259 (patch) | |
tree | 5ffb371ce5b5008052e425955f45c8b808ba7fa0 /tests/test_rebuild_zip.py | |
download | truepolyglot-f57654b84b4cf0ffa1287034fc9f66ba200bb259.tar.gz truepolyglot-f57654b84b4cf0ffa1287034fc9f66ba200bb259.tar.bz2 truepolyglot-f57654b84b4cf0ffa1287034fc9f66ba200bb259.tar.xz |
First public commit
Diffstat (limited to 'tests/test_rebuild_zip.py')
-rwxr-xr-x | tests/test_rebuild_zip.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/test_rebuild_zip.py b/tests/test_rebuild_zip.py new file mode 100755 index 0000000..ceb04a1 --- /dev/null +++ b/tests/test_rebuild_zip.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +import sys +sys.path.append("../") + +import tempfile + +from ZipFileTransformer import Zip, ZipFile + +input_file = "./samples/test1.zip" +output_file = "./samples/test1_out.zip" + +zi = ZipFile(input_file,"r") +zo = ZipFile(output_file,"w") +zo.writestr(' ',b'AAAAAAAAAAAAAAAAAAAAAA',0) +for zipinfo in zi.infolist(): + zo.writestr(zipinfo, zi.read(zipinfo)) +zi.close() +zo.close()
\ No newline at end of file |