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,