Skip to content

Commit

Permalink
TST: Improve test_get_contents_from_nullobject to show real use-case
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan6419846 committed Mar 16, 2024
1 parent c943f5f commit cac7343
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/test_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -1317,9 +1317,11 @@ def test_merge_with_no_resources():
def test_get_contents_from_nullobject():
"""Issue #2157"""
writer = PdfWriter()
p = writer.add_blank_page(100, 100)
p[NameObject("/Contents")] = writer._add_object(NullObject())
p.get_contents()
page1 = writer.add_blank_page(100, 100)
page1[NameObject("/Contents")] = writer._add_object(NullObject())
assert page1.get_contents() is None
page2 = writer.add_blank_page(100, 100)
page1.merge_page(page2, over=True)


@pytest.mark.enable_socket()
Expand Down

0 comments on commit cac7343

Please sign in to comment.