Skip to content

Commit b1e0305

Browse files
author
black-isort-bot
committed
[skip ci]: black/isort
1 parent 74269b1 commit b1e0305

File tree

3 files changed

+27
-13
lines changed

3 files changed

+27
-13
lines changed

PyPDFForm/wrapper.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -175,4 +175,6 @@ def register_font(
175175

176176
ttf_file = adapter.fp_or_f_obj_or_stream_to_stream(ttf_file)
177177

178-
return font.register_font(font_name, ttf_file) if ttf_file is not None else False
178+
return (
179+
font.register_font(font_name, ttf_file) if ttf_file is not None else False
180+
)

tests/test_fill_max_length_text_field.py

+23-8
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ def test_fill_max_length_text_field_all_chars(
99
sample_template_with_max_length_text_field, max_length_expected_directory
1010
):
1111
with open(
12-
os.path.join(max_length_expected_directory, "max_length_text_field_all_chars.pdf"), "rb+"
12+
os.path.join(
13+
max_length_expected_directory, "max_length_text_field_all_chars.pdf"
14+
),
15+
"rb+",
1316
) as f:
1417
obj = PyPDFForm(sample_template_with_max_length_text_field).fill(
1518
{
@@ -31,7 +34,10 @@ def test_fill_max_length_text_field_odd_chars(
3134
sample_template_with_max_length_text_field, max_length_expected_directory
3235
):
3336
with open(
34-
os.path.join(max_length_expected_directory, "max_length_text_field_odd_chars.pdf"), "rb+"
37+
os.path.join(
38+
max_length_expected_directory, "max_length_text_field_odd_chars.pdf"
39+
),
40+
"rb+",
3541
) as f:
3642
obj = PyPDFForm(sample_template_with_max_length_text_field).fill(
3743
{
@@ -53,7 +59,10 @@ def test_fill_max_length_text_field_even_chars(
5359
sample_template_with_max_length_text_field, max_length_expected_directory
5460
):
5561
with open(
56-
os.path.join(max_length_expected_directory, "max_length_text_field_even_chars.pdf"), "rb+"
62+
os.path.join(
63+
max_length_expected_directory, "max_length_text_field_even_chars.pdf"
64+
),
65+
"rb+",
5766
) as f:
5867
obj = PyPDFForm(sample_template_with_max_length_text_field).fill(
5968
{
@@ -75,7 +84,8 @@ def test_fill_comb_text_field_all_chars(
7584
sample_template_with_comb_text_field, max_length_expected_directory
7685
):
7786
with open(
78-
os.path.join(max_length_expected_directory, "comb_text_field_all_chars.pdf"), "rb+"
87+
os.path.join(max_length_expected_directory, "comb_text_field_all_chars.pdf"),
88+
"rb+",
7989
) as f:
8090
obj = PyPDFForm(sample_template_with_comb_text_field).fill(
8191
{
@@ -97,7 +107,8 @@ def test_fill_comb_text_field_odd_chars(
97107
sample_template_with_comb_text_field, max_length_expected_directory
98108
):
99109
with open(
100-
os.path.join(max_length_expected_directory, "comb_text_field_odd_chars.pdf"), "rb+"
110+
os.path.join(max_length_expected_directory, "comb_text_field_odd_chars.pdf"),
111+
"rb+",
101112
) as f:
102113
obj = PyPDFForm(sample_template_with_comb_text_field).fill(
103114
{
@@ -119,7 +130,8 @@ def test_fill_comb_text_field_even_chars(
119130
sample_template_with_comb_text_field, max_length_expected_directory
120131
):
121132
with open(
122-
os.path.join(max_length_expected_directory, "comb_text_field_even_chars.pdf"), "rb+"
133+
os.path.join(max_length_expected_directory, "comb_text_field_even_chars.pdf"),
134+
"rb+",
123135
) as f:
124136
obj = PyPDFForm(sample_template_with_comb_text_field).fill(
125137
{
@@ -140,7 +152,9 @@ def test_fill_comb_text_field_even_chars(
140152
def test_fill_comb_text_field_void(
141153
sample_template_with_comb_text_field, max_length_expected_directory
142154
):
143-
with open(os.path.join(max_length_expected_directory, "comb_text_field_void.pdf"), "rb+") as f:
155+
with open(
156+
os.path.join(max_length_expected_directory, "comb_text_field_void.pdf"), "rb+"
157+
) as f:
144158
obj = PyPDFForm(sample_template_with_comb_text_field).fill({})
145159

146160
expected = f.read()
@@ -154,7 +168,8 @@ def test_fill_comb_text_field_even_chars_right_aligned(
154168
):
155169
with open(
156170
os.path.join(
157-
max_length_expected_directory, "comb_text_field_even_chars_right_aligned.pdf"
171+
max_length_expected_directory,
172+
"comb_text_field_even_chars_right_aligned.pdf",
158173
),
159174
"rb+",
160175
) as f:

tests/test_functional.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,7 @@ def test_fill_font_liberation_serif_italic(
3838
with open(os.path.join(font_samples, "LiberationSerif-Italic.ttf"), "rb+") as _f:
3939
stream = _f.read()
4040
_f.seek(0)
41-
PyPDFForm.register_font(
42-
"LiberationSerif-Italic",
43-
stream
44-
)
41+
PyPDFForm.register_font("LiberationSerif-Italic", stream)
4542

4643
with open(
4744
os.path.join(pdf_samples, "sample_filled_font_liberation_serif_italic.pdf"),

0 commit comments

Comments
 (0)