summaryrefslogtreecommitdiff
path: root/tests/test_sanity.py
diff options
context:
space:
mode:
authorJames R. Barlow <jim@purplerock.ca>2017-09-17 01:01:41 -0700
committerJames R. Barlow <jim@purplerock.ca>2017-09-17 01:01:41 -0700
commit1dfdf6d297d2110fda7e10b876f0647d4a659b1e (patch)
treed6b090f9516db771913179f6d2d7522a0eed00c2 /tests/test_sanity.py
parent911e89fc8a88defa309a48c09cea1193d2ca155e (diff)
Make PDF.pages work like a list
Instead of using the add_page/remove_page style API, make .pages a mutable sequence. Then we get slicing and everything. Much cleaner.
Diffstat (limited to 'tests/test_sanity.py')
-rw-r--r--tests/test_sanity.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/test_sanity.py b/tests/test_sanity.py
index 8b2c6b1..1b04684 100644
--- a/tests/test_sanity.py
+++ b/tests/test_sanity.py
@@ -109,7 +109,7 @@ def test_create_pdf(outdir):
qpdf_page_dict = page_dict
page = pdf.make_indirect(qpdf_page_dict)
- pdf.add_page(page, True)
+ pdf.pages.append(page)
pdf.save(outdir / 'hi.pdf')
@@ -145,7 +145,8 @@ def test_copy_page_keepalive(resources, outdir):
src = qpdf.PDF.open(outdir / 'sandwich.pdf')
pdf = qpdf.PDF.open(resources / 'graph.pdf')
- pdf.add_page(src.pages[0])
+ pdf.pages.append(src.pages[0])
+
del src
src = None
(outdir / 'sandwich.pdf').unlink()