Skip to content

Commit

Permalink
TST: Annotations (#1799)
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinThoma committed Apr 16, 2023
1 parent e3ee1a8 commit 6a9831b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/test_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand All @@ -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"
Expand Down

0 comments on commit 6a9831b

Please sign in to comment.