Skip to content

Commit

Permalink
TST: Regression test for issue #88
Browse files Browse the repository at this point in the history
Co-authored-by: Stef Sijben <Stef-Sijben@users.noreply.github.com>
  • Loading branch information
MartinThoma and Stef-Sijben committed Apr 16, 2022
1 parent 354f8ce commit 31fc4ce
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
Binary file added Resources/form.pdf
Binary file not shown.
Binary file added Resources/form_acrobatReader.pdf
Binary file not shown.
Binary file added Resources/form_evince.pdf
Binary file not shown.
16 changes: 16 additions & 0 deletions Tests/test_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,3 +226,19 @@ def test_get_page_of_encrypted_file():
reader.decrypt("test")

reader.getPage(0)


@pytest.mark.parametrize(
"src,expected",
[
("form.pdf", {"foo": ""}),
("form_acrobatReader.pdf", {"foo": "Bar"}),
("form_evince.pdf", {"foo": "bar"}),
],
)
def test_form(src, expected):
"""Check if we can read out form data."""
src = os.path.join(RESOURCE_ROOT, src)
pdf = PdfFileReader(src)
fields = pdf.getFormTextFields()
assert fields == expected

0 comments on commit 31fc4ce

Please sign in to comment.