Skip to content

Commit

Permalink
TST: Added test case for missing /Info in pdf root
Browse files Browse the repository at this point in the history
  • Loading branch information
mnmtz committed Aug 1, 2023
1 parent 3036efe commit 94e296d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Binary file added resources/missing_info.pdf
Binary file not shown.
7 changes: 7 additions & 0 deletions tests/test_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1582,3 +1582,10 @@ def test_missing_fields(pdf_file_path):
writer.pages[0], {"foo": "some filled in text"}, flags=1
)
assert exc.value.args[0] == "No /Fields dictionary in Pdf in PdfWriter Object"


def test_missing_info():
reader = PdfReader(RESOURCE_ROOT / "missing_info.pdf")

writer = PdfWriter(clone_from=reader)
assert len(writer.pages) == len(reader.pages)

0 comments on commit 94e296d

Please sign in to comment.