summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2019-01-10 08:32:44 -0700
committerSean Whitton <spwhitton@spwhitton.name>2019-08-16 09:03:02 +0100
commit4c19ed63d536c6c3bc9dfe5a958c533482a5cbd3 (patch)
treea46a900aab572ce3335b69e57337845f9841bba4
parent16c947b01f6374943d35324d071dda248ed2376f (diff)
disable test_docinfo_problems
Needs a test resource whose DFSG status is in doubt. Gbp-Pq: Name disable-test_docinfo_problems.patch
-rw-r--r--tests/test_metadata.py37
1 files changed, 0 insertions, 37 deletions
diff --git a/tests/test_metadata.py b/tests/test_metadata.py
index 1a1417f..3de8ccf 100644
--- a/tests/test_metadata.py
+++ b/tests/test_metadata.py
@@ -58,12 +58,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')
@@ -337,37 +331,6 @@ def test_remove_attribute_metadata(sandwich):
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)
-
- with pytest.warns(UserWarning) as warned:
- with meta as xmp:
- xmp['xmp:CreateDate'] = 'invalid date'
- assert 'could not be updated' in warned[0].message.args[0]
-
-
-def test_wrong_xml(enron1):
- enron1.Root.Metadata = Stream(
- enron1,
- b"""
- <test><xml>This is valid xml but not valid XMP</xml></test>
- """.strip(),
- )
- meta = enron1.open_metadata()
- with pytest.raises(ValueError, match='not XMP'):
- with meta:
- pass
- with pytest.raises(ValueError, match='not XMP'):
- meta['pdfaid:part']
-
-
def test_no_x_xmpmeta(trivial):
trivial.Root.Metadata = Stream(
trivial,