diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /dev-python/PyPDF2/files |
reinit the tree, so we can have metadata
Diffstat (limited to 'dev-python/PyPDF2/files')
-rw-r--r-- | dev-python/PyPDF2/files/PyPDF2-1.26.0-py3-tests.patch | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/dev-python/PyPDF2/files/PyPDF2-1.26.0-py3-tests.patch b/dev-python/PyPDF2/files/PyPDF2-1.26.0-py3-tests.patch new file mode 100644 index 000000000000..c74491b964a3 --- /dev/null +++ b/dev-python/PyPDF2/files/PyPDF2-1.26.0-py3-tests.patch @@ -0,0 +1,35 @@ +From 6b46d03ee3a5bd5c2c18fae8aec8a0020ee68add Mon Sep 17 00:00:00 2001 +From: Venelin Stoykov <vkstoykov@gmail.com> +Date: Sat, 26 Dec 2015 17:26:00 +0200 +Subject: [PATCH 2/3] Fix tests for Python 3 + +--- + Tests/tests.py | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +diff --git a/Tests/tests.py b/Tests/tests.py +index fa93c10..83b5951 100644 +--- a/Tests/tests.py ++++ b/Tests/tests.py +@@ -27,14 +27,15 @@ def test_PdfReaderFileLoad(self): + ipdf_p1 = ipdf.getPage(0) + + # Retrieve the text of the PDF +- pdftext_file = open(os.path.join(RESOURCE_ROOT, 'crazyones.txt'), 'r') +- pdftext = pdftext_file.read() +- ipdf_p1_text = ipdf_p1.extractText().replace('\n', '') ++ with open(os.path.join(RESOURCE_ROOT, 'crazyones.txt'), 'rb') as pdftext_file: ++ pdftext = pdftext_file.read() ++ ++ ipdf_p1_text = ipdf_p1.extractText().replace('\n', '').encode('utf-8') + + # Compare the text of the PDF to a known source +- self.assertEqual(ipdf_p1_text.encode('utf-8', errors='ignore'), pdftext, ++ self.assertEqual(ipdf_p1_text, pdftext, + msg='PDF extracted text differs from expected value.\n\nExpected:\n\n%r\n\nExtracted:\n\n%r\n\n' +- % (pdftext, ipdf_p1_text.encode('utf-8', errors='ignore'))) ++ % (pdftext, ipdf_p1_text)) + + + class AddJsTestCase(unittest.TestCase): + |