summaryrefslogtreecommitdiff
path: root/tests/test_sanity.py
diff options
context:
space:
mode:
authorJames R. Barlow <jim@purplerock.ca>2017-09-10 15:55:55 -0700
committerJames R. Barlow <jim@purplerock.ca>2017-09-10 15:55:55 -0700
commit50dff1feb74623be4ea1575dc7a8c2dbd4448a58 (patch)
tree45e8eec5601432f7d70c5f17f836fd6471d41ad6 /tests/test_sanity.py
parent225e1190ee52ab92a0aed47b611ba78bfa6691b0 (diff)
Raise password error when no password supplied
Diffstat (limited to 'tests/test_sanity.py')
-rw-r--r--tests/test_sanity.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/test_sanity.py b/tests/test_sanity.py
index bb6eb5c..ce5cb55 100644
--- a/tests/test_sanity.py
+++ b/tests/test_sanity.py
@@ -33,6 +33,11 @@ def test_open_pdf_password_encoding(resources):
qpdf.PDF.open(resources / 'graph-encrypted.pdf', password=b'\x01\xfe')
+def test_open_pdf_no_password_but_needed(resources):
+ with pytest.raises(qpdf.PasswordError):
+ qpdf.PDF.open(resources / 'graph-encrypted.pdf')
+
+
def test_attr_access(resources):
pdf = qpdf.PDF.open(resources / 'graph.pdf')
assert int(pdf.root.Pages.Count) == 1