Skip to content

Commit

Permalink
Merge pull request #754 from chinapandaman/PPF-753
Browse files Browse the repository at this point in the history
PPF-753: cleanup PR-750 test resources
  • Loading branch information
chinapandaman authored Oct 23, 2024
2 parents 721f18d + c928429 commit 85ea61b
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
File renamed without changes.
36 changes: 18 additions & 18 deletions tests/test_fill_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
from PyPDFForm import PdfWrapper


def test_fill_with_varied_int_values(pdf_samples, request):
expected_path = os.path.join(pdf_samples, "sample_filled_varied_ints.pdf")
def test_fill_with_varied_int_values(template_stream, pdf_samples, request):
expected_path = os.path.join(pdf_samples, "fill_method", "sample_filled_varied_ints.pdf")
with open(expected_path, "rb+") as f:
obj = PdfWrapper(os.path.join(pdf_samples, "sample_template.pdf")).fill(
obj = PdfWrapper(template_stream).fill(
{
"test": 100,
"test_2": -250,
Expand All @@ -25,10 +25,10 @@ def test_fill_with_varied_int_values(pdf_samples, request):
assert obj.read() == expected


def test_fill_with_boolean_and_int_values(pdf_samples, request):
expected_path = os.path.join(pdf_samples, "sample_filled_boolean_and_ints.pdf")
def test_fill_with_boolean_and_int_values(template_stream, pdf_samples, request):
expected_path = os.path.join(pdf_samples, "fill_method", "sample_filled_boolean_and_ints.pdf")
with open(expected_path, "rb+") as f:
obj = PdfWrapper(os.path.join(pdf_samples, "sample_template.pdf")).fill(
obj = PdfWrapper(template_stream).fill(
{
"test": 42,
"test_2": True,
Expand All @@ -45,12 +45,12 @@ def test_fill_with_boolean_and_int_values(pdf_samples, request):
assert obj.read() == expected


def test_fill_with_empty_string_and_int(pdf_samples, request):
def test_fill_with_empty_string_and_int(template_stream, pdf_samples, request):
expected_path = os.path.join(
pdf_samples, "sample_filled_with_empty_string_and_int.pdf"
pdf_samples, "fill_method", "sample_filled_with_empty_string_and_int.pdf"
)
with open(expected_path, "rb+") as f:
obj = PdfWrapper(os.path.join(pdf_samples, "sample_template.pdf")).fill(
obj = PdfWrapper(template_stream).fill(
{
"test": 42,
"test_2": "",
Expand All @@ -67,10 +67,10 @@ def test_fill_with_empty_string_and_int(pdf_samples, request):
assert obj.read() == expected


def test_fill_with_large_and_small_ints(pdf_samples, request):
expected_path = os.path.join(pdf_samples, "sample_filled_large_and_small_ints.pdf")
def test_fill_with_large_and_small_ints(template_stream, pdf_samples, request):
expected_path = os.path.join(pdf_samples, "fill_method", "sample_filled_large_and_small_ints.pdf")
with open(expected_path, "rb+") as f:
obj = PdfWrapper(os.path.join(pdf_samples, "sample_template.pdf")).fill(
obj = PdfWrapper(template_stream).fill(
{
"test": 999999999999,
"test_2": -999999999999,
Expand All @@ -87,10 +87,10 @@ def test_fill_with_large_and_small_ints(pdf_samples, request):
assert obj.read() == expected


def test_fill_with_varied_float_values(pdf_samples, request):
expected_path = os.path.join(pdf_samples, "sample_filled_varied_float_values.pdf")
def test_fill_with_varied_float_values(template_stream, pdf_samples, request):
expected_path = os.path.join(pdf_samples, "fill_method", "sample_filled_varied_float_values.pdf")
with open(expected_path, "rb+") as f:
obj = PdfWrapper(os.path.join(pdf_samples, "sample_template.pdf")).fill(
obj = PdfWrapper(template_stream).fill(
{
"test": 1.5,
"test_2": 13.8,
Expand All @@ -107,12 +107,12 @@ def test_fill_with_varied_float_values(pdf_samples, request):
assert obj.read() == expected


def test_fill_with_negative_and_positive_floats_and_int(pdf_samples, request):
def test_fill_with_negative_and_positive_floats_and_int(template_stream, pdf_samples, request):
expected_path = os.path.join(
pdf_samples, "sample_filled_negative_and_positive_floats_and_int.pdf"
pdf_samples, "fill_method", "sample_filled_negative_and_positive_floats_and_int.pdf"
)
with open(expected_path, "rb+") as f:
obj = PdfWrapper(os.path.join(pdf_samples, "sample_template.pdf")).fill(
obj = PdfWrapper(template_stream).fill(
{
"test": -1.5,
"test_2": -6.9,
Expand Down

0 comments on commit 85ea61b

Please sign in to comment.