Skip to content

Commit

Permalink
Merge pull request #546 from chinapandaman/PPF-545
Browse files Browse the repository at this point in the history
PPF-545: fix issue test pycharm linting
  • Loading branch information
chinapandaman committed Mar 28, 2024
2 parents 0ca69ba + c6d6ea8 commit 9d5fd8f
Showing 1 changed file with 21 additions and 23 deletions.
44 changes: 21 additions & 23 deletions tests/scenario/test_issues_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,20 @@ def test_pdf_form_with_paragraph_fields_new_line_symbol_text(
expected_path = os.path.join(
pdf_samples, "simple", "scenario", "issues", "PPF-415-expected.pdf"
)
with open(expected_path, "rb+") as f:
obj = FormWrapper(os.path.join(issue_pdf_directory, "PPF-415.pdf")).fill(
{"Address": "Mr John Smith\n132, My Street\nKingston, New York 12401"}
)
obj = FormWrapper(os.path.join(issue_pdf_directory, "PPF-415.pdf")).fill(
{"Address": "Mr John Smith\n132, My Street\nKingston, New York 12401"}
)

request.config.results["expected_path"] = expected_path
request.config.results["stream"] = obj.read()
request.config.results["expected_path"] = expected_path
request.config.results["stream"] = obj.read()

for _, widgets in get_widgets_by_page(obj.read()).items():
for widget in widgets:
if get_widget_key(widget) == "Address":
assert (
widget[V]
== "Mr John Smith\n132, My Street\nKingston, New York 12401"
)
for _, widgets in get_widgets_by_page(obj.read()).items():
for widget in widgets:
if get_widget_key(widget) == "Address":
assert (
widget[V]
== "Mr John Smith\n132, My Street\nKingston, New York 12401"
)


def test_pdf_form_with_paragraph_fields_new_line_symbol_text_overflow(
Expand Down Expand Up @@ -146,18 +145,17 @@ def test_pdf_form_with_paragraph_fields_new_line_symbol_short_text(
expected_path = os.path.join(
pdf_samples, "simple", "scenario", "issues", "PPF-415-3-expected.pdf"
)
with open(expected_path, "rb+") as f:
obj = FormWrapper(os.path.join(issue_pdf_directory, "PPF-415.pdf")).fill(
{"Address": "J Smith\n132 A St\nNYC, NY 12401"}
)
obj = FormWrapper(os.path.join(issue_pdf_directory, "PPF-415.pdf")).fill(
{"Address": "J Smith\n132 A St\nNYC, NY 12401"}
)

request.config.results["expected_path"] = expected_path
request.config.results["stream"] = obj.read()
request.config.results["expected_path"] = expected_path
request.config.results["stream"] = obj.read()

for _, widgets in get_widgets_by_page(obj.read()).items():
for widget in widgets:
if get_widget_key(widget) == "Address":
assert widget[V] == "J Smith\n132 A St\nNYC, NY 12401"
for _, widgets in get_widgets_by_page(obj.read()).items():
for widget in widgets:
if get_widget_key(widget) == "Address":
assert widget[V] == "J Smith\n132 A St\nNYC, NY 12401"


def test_encrypted_edit_pdf_form(issue_pdf_directory, pdf_samples, request):
Expand Down

0 comments on commit 9d5fd8f

Please sign in to comment.