From 6a9831be7b6f6e0762f6b8406e8d22a006d94227 Mon Sep 17 00:00:00 2001 From: Martin Thoma Date: Sun, 16 Apr 2023 20:09:27 +0200 Subject: [PATCH] TST: Annotations (#1799) --- tests/test_generic.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/test_generic.py b/tests/test_generic.py index 95c2c060b..dfac41c9a 100644 --- a/tests/test_generic.py +++ b/tests/test_generic.py @@ -930,7 +930,6 @@ def test_annotation_builder_link(pdf_file_path): link_annotation = AnnotationBuilder.link( rect=(50, 50, 100, 100), url="https://martin-thoma.com/", - border=[1, 0, 6, [3, 2]], ) writer.add_annotation(0, link_annotation) @@ -971,7 +970,7 @@ def test_annotation_builder_text(pdf_file_path): writer.write(fp) -def test_annotation_builder_popup(): +def test_annotation_builder_popup(caplog): # Arrange pdf_path = RESOURCE_ROOT / "outline-without-title.pdf" reader = PdfReader(pdf_path) @@ -993,6 +992,14 @@ def test_annotation_builder_popup(): parent=ta, # prefer to use for evolutivity ) + assert caplog.text == "" + AnnotationBuilder.popup( + rect=(50, 550, 200, 650), + open=True, + parent=True, # broken parameter # type: ignore + ) + assert "Unregistered Parent object : No Parent field set" in caplog.text + writer.add_annotation(writer.pages[0], popup_annotation) target = "annotated-pdf-popup.pdf"