Skip to content

Commit

Permalink
tests/: added test for test_3950().
Browse files Browse the repository at this point in the history
Currently expects incorrect current behaviour.
  • Loading branch information
julian-smith-artifex-com committed Oct 22, 2024
1 parent b405b5b commit 5b49aa7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Binary file added tests/resources/test_3950.pdf
Binary file not shown.
17 changes: 17 additions & 0 deletions tests/test_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,3 +317,20 @@ def test_interfield_calculation():
pymupdf.mupdf.pdf_to_num(pymupdf.mupdf.pdf_array_get(CO, i))
== list(page.widgets())[-1].xref
)


def test_3950():
path = os.path.normpath(f'{__file__}/../../tests/resources/test_3950.pdf')
items = list()
with pymupdf.open(path) as document:
for page in document:
for widget in page.widgets():
items.append(widget.field_label)
print(f'test_3950(): {widget.field_label=}.')
assert items == [
'',
#'{{ named_insured }}',
'{{ policy_period_start_date }}',
'{{ policy_period_end_date }}',
'{{ insurance_line }}',
]

0 comments on commit 5b49aa7

Please sign in to comment.