summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2019-01-10 08:33:44 -0700
committerSean Whitton <spwhitton@spwhitton.name>2019-01-10 08:40:35 -0700
commit71fa6042381605ee3853df45e00c9738fd094d1d (patch)
tree119a81f1419c48121cb347f8bcec61bb246ab547
parent58b98c791444a8f043e67a47aa6b2ca3cc1b071d (diff)
Add disable-test_docinfo_problems.patch
-rw-r--r--debian/changelog1
-rw-r--r--debian/patches/disable-test_docinfo_problems.patch41
-rw-r--r--debian/patches/series1
3 files changed, 43 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index 41e038d..6f95a37 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,7 @@ pikepdf (1.0.4+dfsg-1) UNRELEASED; urgency=medium
* New upstream release.
- Add Files-Excluded to d/copyright.
See https://github.com/pikepdf/pikepdf/issues/21
+ - Add disable-test_docinfo_problems.patch
* Install examples/find_links.py
-- Sean Whitton <spwhitton@spwhitton.name> Thu, 10 Jan 2019 08:19:03 -0700
diff --git a/debian/patches/disable-test_docinfo_problems.patch b/debian/patches/disable-test_docinfo_problems.patch
new file mode 100644
index 0000000..8622872
--- /dev/null
+++ b/debian/patches/disable-test_docinfo_problems.patch
@@ -0,0 +1,41 @@
+From: Sean Whitton <spwhitton@spwhitton.name>
+Date: Thu, 10 Jan 2019 08:32:44 -0700
+Subject: disable test_docinfo_problems
+
+Needs a test resource whose DFSG status is in doubt.
+---
+ tests/test_metadata.py | 17 -----------------
+ 1 file changed, 17 deletions(-)
+
+diff --git a/tests/test_metadata.py b/tests/test_metadata.py
+index 35eff81..8d4fae5 100644
+--- a/tests/test_metadata.py
++++ b/tests/test_metadata.py
+@@ -48,12 +48,6 @@ def trivial(resources):
+
+
+ @pytest.fixture
+-def enron1(resources):
+- # Has nuls in docinfo, old PDF
+- return Pdf.open(resources / 'enron1_gs.pdf')
+-
+-
+-@pytest.fixture
+ def invalid_creationdate(resources):
+ # Has nuls in docinfo, old PDF
+ return Pdf.open(resources / 'invalid_creationdate.pdf')
+@@ -290,14 +284,3 @@ def test_remove_attribute_metadata(sandwich):
+
+ # Ensure the whole node was deleted
+ assert not re.search(r'rdf:Description xmlns:[^\s]+ rdf:about=""/', str(xmp))
+-
+-
+-def test_docinfo_problems(enron1, invalid_creationdate):
+- meta = enron1.open_metadata()
+- meta._load() # File has invalid XML sequence &#0;
+- with meta:
+- with pytest.warns(UserWarning) as warned:
+- meta.load_from_docinfo(invalid_creationdate.docinfo)
+- assert 'could not be copied' in warned[0].message.args[0]
+- with pytest.raises(ValueError):
+- meta.load_from_docinfo(invalid_creationdate.docinfo, raise_failure=True)
diff --git a/debian/patches/series b/debian/patches/series
index 7e432cc..3188de5 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
docs-build-use-DEB_VERSION_UPSTREAM.patch
drop-installation-from-docs-contents.patch
drop-setuptools_scm_git_archive-from-setup.py.patch
+disable-test_docinfo_problems.patch