9
9
10
10
@pytest .fixture
11
11
def expected_directory ():
12
- return os .path .join (os .path .dirname (__file__ ), ".." , ".." , "pdf_samples" , "max_length_text_field_related" )
12
+ return os .path .join (
13
+ os .path .dirname (__file__ ),
14
+ ".." ,
15
+ ".." ,
16
+ "pdf_samples" ,
17
+ "max_length_text_field_related" ,
18
+ )
13
19
14
20
15
21
def test_fill_max_length_text_field_all_chars (
16
22
sample_template_with_max_length_text_field , expected_directory
17
23
):
18
- with open (os .path .join (expected_directory , "max_length_text_field_all_chars.pdf" ), "rb+" ) as f :
24
+ with open (
25
+ os .path .join (expected_directory , "max_length_text_field_all_chars.pdf" ), "rb+"
26
+ ) as f :
19
27
obj = PyPDFForm2 (sample_template_with_max_length_text_field ).fill (
20
28
{
21
29
"FirstName" : "John" ,
22
30
"MiddleName" : "Joe" ,
23
31
"LastName" : "XXXXXXXXXX" ,
24
32
"Awesomeness" : True ,
25
- "Gender" : 0
33
+ "Gender" : 0 ,
26
34
}
27
35
)
28
36
@@ -35,14 +43,16 @@ def test_fill_max_length_text_field_all_chars(
35
43
def test_fill_max_length_text_field_odd_chars (
36
44
sample_template_with_max_length_text_field , expected_directory
37
45
):
38
- with open (os .path .join (expected_directory , "max_length_text_field_odd_chars.pdf" ), "rb+" ) as f :
46
+ with open (
47
+ os .path .join (expected_directory , "max_length_text_field_odd_chars.pdf" ), "rb+"
48
+ ) as f :
39
49
obj = PyPDFForm2 (sample_template_with_max_length_text_field ).fill (
40
50
{
41
51
"FirstName" : "John" ,
42
52
"MiddleName" : "Joe" ,
43
53
"LastName" : "XXX" ,
44
54
"Awesomeness" : True ,
45
- "Gender" : 0
55
+ "Gender" : 0 ,
46
56
}
47
57
)
48
58
@@ -55,14 +65,16 @@ def test_fill_max_length_text_field_odd_chars(
55
65
def test_fill_max_length_text_field_even_chars (
56
66
sample_template_with_max_length_text_field , expected_directory
57
67
):
58
- with open (os .path .join (expected_directory , "max_length_text_field_even_chars.pdf" ), "rb+" ) as f :
68
+ with open (
69
+ os .path .join (expected_directory , "max_length_text_field_even_chars.pdf" ), "rb+"
70
+ ) as f :
59
71
obj = PyPDFForm2 (sample_template_with_max_length_text_field ).fill (
60
72
{
61
73
"FirstName" : "John" ,
62
74
"MiddleName" : "Joe" ,
63
75
"LastName" : "XXXX" ,
64
76
"Awesomeness" : True ,
65
- "Gender" : 0
77
+ "Gender" : 0 ,
66
78
}
67
79
)
68
80
@@ -75,14 +87,16 @@ def test_fill_max_length_text_field_even_chars(
75
87
def test_fill_comb_text_field_all_chars (
76
88
sample_template_with_comb_text_field , expected_directory
77
89
):
78
- with open (os .path .join (expected_directory , "comb_text_field_all_chars.pdf" ), "rb+" ) as f :
90
+ with open (
91
+ os .path .join (expected_directory , "comb_text_field_all_chars.pdf" ), "rb+"
92
+ ) as f :
79
93
obj = PyPDFForm2 (sample_template_with_comb_text_field ).fill (
80
94
{
81
95
"FirstName" : "John" ,
82
96
"MiddleName" : "Joe" ,
83
97
"LastName" : "XXXXXXXXXX" ,
84
98
"Awesomeness" : True ,
85
- "Gender" : 0
99
+ "Gender" : 0 ,
86
100
}
87
101
)
88
102
@@ -95,14 +109,16 @@ def test_fill_comb_text_field_all_chars(
95
109
def test_fill_comb_text_field_odd_chars (
96
110
sample_template_with_comb_text_field , expected_directory
97
111
):
98
- with open (os .path .join (expected_directory , "comb_text_field_odd_chars.pdf" ), "rb+" ) as f :
112
+ with open (
113
+ os .path .join (expected_directory , "comb_text_field_odd_chars.pdf" ), "rb+"
114
+ ) as f :
99
115
obj = PyPDFForm2 (sample_template_with_comb_text_field ).fill (
100
116
{
101
117
"FirstName" : "John" ,
102
118
"MiddleName" : "Joe" ,
103
119
"LastName" : "XXX" ,
104
120
"Awesomeness" : True ,
105
- "Gender" : 0
121
+ "Gender" : 0 ,
106
122
}
107
123
)
108
124
@@ -115,14 +131,16 @@ def test_fill_comb_text_field_odd_chars(
115
131
def test_fill_comb_text_field_even_chars (
116
132
sample_template_with_comb_text_field , expected_directory
117
133
):
118
- with open (os .path .join (expected_directory , "comb_text_field_even_chars.pdf" ), "rb+" ) as f :
134
+ with open (
135
+ os .path .join (expected_directory , "comb_text_field_even_chars.pdf" ), "rb+"
136
+ ) as f :
119
137
obj = PyPDFForm2 (sample_template_with_comb_text_field ).fill (
120
138
{
121
139
"FirstName" : "John" ,
122
140
"MiddleName" : "Joe" ,
123
141
"LastName" : "XXXXXX" ,
124
142
"Awesomeness" : True ,
125
- "Gender" : 0
143
+ "Gender" : 0 ,
126
144
}
127
145
)
128
146
0 commit comments