summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJames R. Barlow <jim@purplerock.ca>2018-09-18 13:12:33 -0700
committerJames R. Barlow <jim@purplerock.ca>2018-09-18 13:12:33 -0700
commite9d3085cf8a995339b9f4069cf0ba8551a128bae (patch)
tree9f406b871723e64cb0c007c3498c359b7c9a7cb8 /tests
parentc9814440f9e600dd8be202f9e13426d73a0ebc98 (diff)
Implement progress reporting callback
Diffstat (limited to 'tests')
-rw-r--r--tests/test_pdf.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_pdf.py b/tests/test_pdf.py
index 3d175c5..57c2ed6 100644
--- a/tests/test_pdf.py
+++ b/tests/test_pdf.py
@@ -6,6 +6,8 @@ import pytest
from pikepdf import Pdf, PasswordError, Stream
from io import StringIO
+from unittest.mock import Mock
+
def test_non_filename():
with pytest.raises(TypeError):
@@ -103,3 +105,10 @@ def test_remove_unreferenced(resources, outdir):
def test_show_xref(resources):
pdf = Pdf.open(resources / 'pal-1bit-trivial.pdf')
pdf.show_xref_table()
+
+
+def test_progress(resources, outdir):
+ pdf = Pdf.open(resources / 'pal-1bit-trivial.pdf')
+ mock = Mock()
+ pdf.save(outdir / 'out.pdf', progress=mock)
+ mock.assert_called()