Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PPF-545: fix issue test pycharm linting #546

Merged
merged 1 commit into from
Mar 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading