diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2019-01-10 08:32:44 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2019-12-11 11:38:08 -0700 |
commit | 67e7762658c7fab14e4499aed9a1785c3ebdcd4e (patch) | |
tree | 9a22815bd5c0a07bae1a6b2475c391ebbe05a5b1 | |
parent | 0fa4e85a356d5d16858b1cb782bf01108d77b5ea (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.py | 37 |
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 � - 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, |