diff options
author | James R. Barlow <jim@purplerock.ca> | 2019-04-13 14:45:08 -0700 |
---|---|---|
committer | James R. Barlow <jim@purplerock.ca> | 2019-04-13 14:45:08 -0700 |
commit | 7ba2fd863f2470aebd2f013923eed383f5226da7 (patch) | |
tree | cdb7eb9096db0047e6e55410afcbf44e5ab1e8a4 /tests | |
parent | d6cdb2c6570b88eb3d0c2bec1d488eea6eb686e9 (diff) |
Update description of Pdf.close behavior
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_pdf.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test_pdf.py b/tests/test_pdf.py index 9c4ec60..d9d7422 100644 --- a/tests/test_pdf.py +++ b/tests/test_pdf.py @@ -224,3 +224,10 @@ def test_with_block(resources): with pikepdf.open(resources / 'pal-1bit-trivial.pdf') as pdf: desc = pdf.filename assert pdf.filename != desc + + +def test_with_block_abuse(resources): + with pikepdf.open(resources / 'pal-1bit-trivial.pdf') as pdf: + im0 = pdf.pages[0].Resources.XObject['/Im0'] + with pytest.raises(PdfError): + im0.read_bytes() |