diff options
author | James R. Barlow <jim@purplerock.ca> | 2018-06-25 13:04:45 -0700 |
---|---|---|
committer | James R. Barlow <jim@purplerock.ca> | 2018-06-25 13:04:45 -0700 |
commit | 5c6b980b39b21fe9090ed421a7cbeefc94acd730 (patch) | |
tree | b2ec4be5ae6f84596fe600058dd542ac1b37972f /tests | |
parent | 67dd16d225bdf845e28f70cd5907a3f91a3ef2ac (diff) |
Add slice test for different length replacement
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_pages.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_pages.py b/tests/test_pages.py index 1573e56..67c61c4 100644 --- a/tests/test_pages.py +++ b/tests/test_pages.py @@ -160,6 +160,15 @@ def test_slice_with_step(resources, outdir): for page in pdf.pages[0::2]) +def test_slice_differing_lengths(resources): + pdf = Pdf.open(resources / 'fourpages.pdf') + pdf2 = Pdf.open(resources / 'sandwich.pdf') + + with pytest.raises(ValueError, + message="attempt to assign"): + pdf.pages[0::2] = pdf2.pages[0:1] + + @pytest.mark.timeout(1) def test_self_extend(resources): pdf = Pdf.open(resources / 'fourpages.pdf') |