From f57654b84b4cf0ffa1287034fc9f66ba200bb259 Mon Sep 17 00:00:00 2001 From: ben Date: Tue, 18 Sep 2018 10:52:38 +0200 Subject: First public commit --- tests/test_zip.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 tests/test_zip.py (limited to 'tests/test_zip.py') diff --git a/tests/test_zip.py b/tests/test_zip.py new file mode 100755 index 0000000..81b8f6e --- /dev/null +++ b/tests/test_zip.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +import sys +sys.path.append("../") + +import tempfile + +from ZipFileTransformer import Zip + +input_file = "./samples/test1.zip" +output_file = tempfile.mktemp() +print("Output: " + output_file) + +z = Zip(input_file) +a = bytearray(b'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA') +b = bytearray(b'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB') +z.add_data_to_file(a, b, False) +g = open(output_file, "wb") +g.write(a + z.get_local_file_data() + b + z.get_data_after_central_directory()) +g.close() -- cgit v1.2.3