@@ -52,7 +52,7 @@ def test_render_styled_Image():
52
52
53
53
def test_render_styled_with_embeded_image ():
54
54
embeded_img = Image .new ("RGB" , (10 , 10 ), color = "red" )
55
- qr = qrcode .QRCode (error_correction = qrcode .ERROR_CORRECT_L )
55
+ qr = qrcode .QRCode (error_correction = qrcode .ERROR_CORRECT_H )
56
56
qr .add_data (UNICODE_TEXT )
57
57
img = qr .make_image (image_factory = StyledPilImage , embeded_image = embeded_img )
58
58
img .save (io .BytesIO ())
@@ -129,21 +129,28 @@ def test_embedded_image_and_error_correction(tmp_path):
129
129
qr .add_data (UNICODE_TEXT )
130
130
with pytest .raises (ValueError ):
131
131
qr .make_image (embeded_image_path = tmpfile )
132
+ with pytest .raises (ValueError ):
133
+ qr .make_image (embeded_image = embedded_img )
132
134
133
135
qr = qrcode .QRCode (error_correction = qrcode .ERROR_CORRECT_M )
134
136
qr .add_data (UNICODE_TEXT )
135
137
with pytest .raises (ValueError ):
136
138
qr .make_image (embeded_image_path = tmpfile )
139
+ with pytest .raises (ValueError ):
140
+ qr .make_image (embeded_image = embedded_img )
137
141
138
142
qr = qrcode .QRCode (error_correction = qrcode .ERROR_CORRECT_Q )
139
143
qr .add_data (UNICODE_TEXT )
140
144
with pytest .raises (ValueError ):
141
145
qr .make_image (embeded_image_path = tmpfile )
146
+ with pytest .raises (ValueError ):
147
+ qr .make_image (embeded_image = embedded_img )
142
148
143
149
# The only accepted correction level when an embedded image is provided
144
150
qr = qrcode .QRCode (error_correction = qrcode .ERROR_CORRECT_H )
145
151
qr .add_data (UNICODE_TEXT )
146
152
qr .make_image (embeded_image_path = tmpfile )
153
+ qr .make_image (embeded_image = embedded_img )
147
154
148
155
149
156
def test_shortcut ():
0 commit comments