summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJames R. Barlow <jim@purplerock.ca>2019-02-10 23:47:59 -0800
committerJames R. Barlow <jim@purplerock.ca>2019-02-10 23:47:59 -0800
commiteaca990c7dfa13571aa8cc10fed80219971bb032 (patch)
tree776d5afaad20cd4745f286279c6884f6fe25ea5e /tests
parent0dd8a849e5e0c5b4f198aa1ea17031db07b82bbe (diff)
Add regression test for issue #22
Diffstat (limited to 'tests')
-rw-r--r--tests/test_pages.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_pages.py b/tests/test_pages.py
index 75328d8..de52ba4 100644
--- a/tests/test_pages.py
+++ b/tests/test_pages.py
@@ -244,3 +244,17 @@ def test_negative_indexing(fourpages, graph):
fourpages.pages[-42] = graph.pages[0]
with pytest.raises(IndexError):
del fourpages.pages[-42]
+
+
+def test_concatenate(resources, outdir):
+ # Issue #22
+ def concatenate(n):
+ print('concatenating same page', n, 'times')
+ output_pdf = Pdf.new()
+ for i in range(n):
+ print(i)
+ pdf_page = Pdf.open(resources / 'pal.pdf')
+ output_pdf.pages.extend(pdf_page.pages)
+ output_pdf.save(outdir / '{}.pdf'.format(n))
+
+ concatenate(5)