@@ -87,7 +87,10 @@ async def test_attachement_message(mail_config):
87
87
88
88
assert len (outbox ) == 1
89
89
assert mail ._payload [1 ].get_content_maintype () == "application"
90
- assert mail ._payload [1 ].__dict__ .get ("_headers" )[0 ][1 ] == "application/octet-stream"
90
+ assert (
91
+ mail ._payload [1 ].__dict__ .get ("_headers" )[0 ][1 ]
92
+ == "application/octet-stream"
93
+ )
91
94
92
95
93
96
@pytest .mark .asyncio
@@ -149,16 +152,20 @@ async def test_attachement_message_with_headers(mail_config):
149
152
150
153
assert len (outbox ) == 1
151
154
mail = outbox [0 ]
152
- assert mail ._payload [1 ].get_content_maintype () == msg .attachments [0 ][1 ].get ("mime_type" )
153
- assert mail ._payload [1 ].get_content_subtype () == msg .attachments [0 ][1 ].get ("mime_subtype" )
155
+ assert mail ._payload [1 ].get_content_maintype () == msg .attachments [0 ][1 ].get (
156
+ "mime_type"
157
+ )
158
+ assert mail ._payload [1 ].get_content_subtype () == msg .attachments [0 ][1 ].get (
159
+ "mime_subtype"
160
+ )
154
161
155
162
assert mail ._payload [1 ].__dict__ .get ("_headers" )[0 ][1 ] == "image/png"
156
- assert mail ._payload [1 ].__dict__ .get ("_headers" )[3 ][1 ] == msg .attachments [0 ][1 ]. get (
157
- "headers"
158
- ).get ("Content-ID" )
159
- assert mail ._payload [1 ].__dict__ .get ("_headers" )[4 ][1 ] == msg .attachments [0 ][1 ]. get (
160
- "headers"
161
- ).get ("Content-Disposition" )
163
+ assert mail ._payload [1 ].__dict__ .get ("_headers" )[3 ][1 ] == msg .attachments [0 ][
164
+ 1
165
+ ]. get ( "headers" ).get ("Content-ID" )
166
+ assert mail ._payload [1 ].__dict__ .get ("_headers" )[4 ][1 ] == msg .attachments [0 ][
167
+ 1
168
+ ]. get ( "headers" ).get ("Content-Disposition" )
162
169
163
170
assert (
164
171
mail ._payload [2 ].__dict__ .get ("_headers" )[3 ][1 ] == "attachment; "
@@ -182,7 +189,9 @@ async def test_jinja_message_list(mail_config):
182
189
fm = FastMail (conf )
183
190
184
191
with fm .record_messages () as outbox :
185
- await fm .send_message (message = msg , template_name = "array_iteration_jinja_template.html" )
192
+ await fm .send_message (
193
+ message = msg , template_name = "array_iteration_jinja_template.html"
194
+ )
186
195
187
196
assert len (outbox ) == 1
188
197
mail = outbox [0 ]
@@ -248,7 +257,7 @@ async def test_send_msg_with_subtype(mail_config):
248
257
msg = MessageSchema (
249
258
subject = "testing" ,
250
259
251
- body = "<p Test data </p>" ,
260
+ body = "<p> Test data </p>" ,
252
261
subtype = MessageType .html ,
253
262
)
254
263
@@ -263,7 +272,7 @@ async def test_send_msg_with_subtype(mail_config):
263
272
assert outbox [0 ]["subject" ] == "testing"
264
273
assert outbox [0 ]["from" ] == sender
265
274
assert outbox [
0 ][
"To" ]
== "[email protected] "
266
- assert msg .body == "<p Test data </p>"
275
+ assert msg .body == "<p> Test data </p>"
267
276
assert msg .subtype == MessageType .html
268
277
269
278
@@ -281,7 +290,9 @@ async def test_jinja_message_with_html(mail_config):
281
290
)
282
291
conf = ConnectionConfig (** mail_config )
283
292
fm = FastMail (conf )
284
- await fm .send_message (message = msg , template_name = "array_iteration_jinja_template.html" )
293
+ await fm .send_message (
294
+ message = msg , template_name = "array_iteration_jinja_template.html"
295
+ )
285
296
286
297
assert msg .template_body == ("\n \n \n Andrej\n \n \n " )
287
298
@@ -293,7 +304,7 @@ async def test_send_msg_with_alternative_body(mail_config):
293
304
msg = MessageSchema (
294
305
subject = "testing" ,
295
306
296
- body = "<p Test data </p>" ,
307
+ body = "<p> Test data </p>" ,
297
308
subtype = MessageType .html ,
298
309
alternative_body = "Test data" ,
299
310
multipart_subtype = MultipartSubtypeEnum .alternative ,
@@ -361,4 +372,7 @@ async def test_send_msg_with_alternative_body_and_attachements(mail_config):
361
372
assert body ._payload [1 ]._headers [0 ][1 ] == 'text/plain; charset="utf-8"'
362
373
363
374
assert mail ._payload [1 ].get_content_maintype () == "application"
364
- assert mail ._payload [1 ].__dict__ .get ("_headers" )[0 ][1 ] == "application/octet-stream"
375
+ assert (
376
+ mail ._payload [1 ].__dict__ .get ("_headers" )[0 ][1 ]
377
+ == "application/octet-stream"
378
+ )
0 commit comments