aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_polyglot_pdfzip.py
diff options
context:
space:
mode:
authorben2018-09-18 10:52:38 +0200
committerben2018-09-18 10:52:38 +0200
commitf57654b84b4cf0ffa1287034fc9f66ba200bb259 (patch)
tree5ffb371ce5b5008052e425955f45c8b808ba7fa0 /tests/test_polyglot_pdfzip.py
downloadtruepolyglot-f57654b84b4cf0ffa1287034fc9f66ba200bb259.tar.gz
truepolyglot-f57654b84b4cf0ffa1287034fc9f66ba200bb259.tar.bz2
truepolyglot-f57654b84b4cf0ffa1287034fc9f66ba200bb259.tar.xz
First public commit
Diffstat (limited to 'tests/test_polyglot_pdfzip.py')
-rwxr-xr-xtests/test_polyglot_pdfzip.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/test_polyglot_pdfzip.py b/tests/test_polyglot_pdfzip.py
new file mode 100755
index 0000000..f4a3ff2
--- /dev/null
+++ b/tests/test_polyglot_pdfzip.py
@@ -0,0 +1,23 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+import sys
+sys.path.append("../")
+
+from PdfFileTransformer import Pdf
+from ZipFileTransformer import Zip
+from PolyglotFile import PolyglotPdfZip
+import logging
+
+input_file_pdf = "./samples/test1.pdf"
+input_file_zip = "./samples/test1.zip"
+output_file = "./samples/test1_out.pdf"
+
+logging.basicConfig(level=logging.DEBUG)
+
+
+p = Pdf(input_file_pdf)
+z = Zip(input_file_zip)
+a = PolyglotPdfZip(p, z)
+a.generate()
+a.write(output_file)