From c928429e215159c67d76b1f42a7f6540b3f8460c Mon Sep 17 00:00:00 2001 From: chinapandaman Date: Wed, 23 Oct 2024 07:49:27 -0500 Subject: [PATCH] PPF-753: move files around --- .../sample_filled_boolean_and_ints.pdf | Bin .../sample_filled_large_and_small_ints.pdf | Bin ...d_negative_and_positive_floats_and_int.pdf | Bin .../sample_filled_varied_float_values.pdf | Bin .../sample_filled_varied_ints.pdf | Bin ...ample_filled_with_empty_string_and_int.pdf | Bin tests/test_fill_method.py | 36 +++++++++--------- 7 files changed, 18 insertions(+), 18 deletions(-) rename pdf_samples/{ => fill_method}/sample_filled_boolean_and_ints.pdf (100%) rename pdf_samples/{ => fill_method}/sample_filled_large_and_small_ints.pdf (100%) rename pdf_samples/{ => fill_method}/sample_filled_negative_and_positive_floats_and_int.pdf (100%) rename pdf_samples/{ => fill_method}/sample_filled_varied_float_values.pdf (100%) rename pdf_samples/{ => fill_method}/sample_filled_varied_ints.pdf (100%) rename pdf_samples/{ => fill_method}/sample_filled_with_empty_string_and_int.pdf (100%) diff --git a/pdf_samples/sample_filled_boolean_and_ints.pdf b/pdf_samples/fill_method/sample_filled_boolean_and_ints.pdf similarity index 100% rename from pdf_samples/sample_filled_boolean_and_ints.pdf rename to pdf_samples/fill_method/sample_filled_boolean_and_ints.pdf diff --git a/pdf_samples/sample_filled_large_and_small_ints.pdf b/pdf_samples/fill_method/sample_filled_large_and_small_ints.pdf similarity index 100% rename from pdf_samples/sample_filled_large_and_small_ints.pdf rename to pdf_samples/fill_method/sample_filled_large_and_small_ints.pdf diff --git a/pdf_samples/sample_filled_negative_and_positive_floats_and_int.pdf b/pdf_samples/fill_method/sample_filled_negative_and_positive_floats_and_int.pdf similarity index 100% rename from pdf_samples/sample_filled_negative_and_positive_floats_and_int.pdf rename to pdf_samples/fill_method/sample_filled_negative_and_positive_floats_and_int.pdf diff --git a/pdf_samples/sample_filled_varied_float_values.pdf b/pdf_samples/fill_method/sample_filled_varied_float_values.pdf similarity index 100% rename from pdf_samples/sample_filled_varied_float_values.pdf rename to pdf_samples/fill_method/sample_filled_varied_float_values.pdf diff --git a/pdf_samples/sample_filled_varied_ints.pdf b/pdf_samples/fill_method/sample_filled_varied_ints.pdf similarity index 100% rename from pdf_samples/sample_filled_varied_ints.pdf rename to pdf_samples/fill_method/sample_filled_varied_ints.pdf diff --git a/pdf_samples/sample_filled_with_empty_string_and_int.pdf b/pdf_samples/fill_method/sample_filled_with_empty_string_and_int.pdf similarity index 100% rename from pdf_samples/sample_filled_with_empty_string_and_int.pdf rename to pdf_samples/fill_method/sample_filled_with_empty_string_and_int.pdf diff --git a/tests/test_fill_method.py b/tests/test_fill_method.py index 085c308c..28e9c3d5 100644 --- a/tests/test_fill_method.py +++ b/tests/test_fill_method.py @@ -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, @@ -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, @@ -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": "", @@ -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, @@ -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, @@ -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,