mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-07-30 10:38:07 -07:00
dev-python/PyPDF2: 1.26.0 version bump, add py3{5,6}, fix tests, EAPI 6
Gentoo-bug: 606466 Package-Manager: Portage-2.3.3, Repoman-2.3.1
This commit is contained in:
35
dev-python/PyPDF2/files/PyPDF2-1.26.0-py3-tests.patch
Normal file
35
dev-python/PyPDF2/files/PyPDF2-1.26.0-py3-tests.patch
Normal file
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user