@@ -89,7 +89,10 @@ async def test_attachement_message(mail_config):
8989
9090 assert len (outbox ) == 1
9191 assert mail ._payload [1 ].get_content_maintype () == "application"
92- assert mail ._payload [1 ].__dict__ .get ("_headers" )[0 ][1 ] == "application/octet-stream"
92+ assert (
93+ mail ._payload [1 ].__dict__ .get ("_headers" )[0 ][1 ]
94+ == "application/octet-stream"
95+ )
9396
9497
9598@pytest .mark .asyncio
@@ -151,16 +154,20 @@ async def test_attachement_message_with_headers(mail_config):
151154
152155 assert len (outbox ) == 1
153156 mail = outbox [0 ]
154- assert mail ._payload [1 ].get_content_maintype () == msg .attachments [0 ][1 ].get ("mime_type" )
155- assert mail ._payload [1 ].get_content_subtype () == msg .attachments [0 ][1 ].get ("mime_subtype" )
157+ assert mail ._payload [1 ].get_content_maintype () == msg .attachments [0 ][1 ].get (
158+ "mime_type"
159+ )
160+ assert mail ._payload [1 ].get_content_subtype () == msg .attachments [0 ][1 ].get (
161+ "mime_subtype"
162+ )
156163
157164 assert mail ._payload [1 ].__dict__ .get ("_headers" )[0 ][1 ] == "image/png"
158- assert mail ._payload [1 ].__dict__ .get ("_headers" )[3 ][1 ] == msg .attachments [0 ][1 ]. get (
159- "headers"
160- ).get ("Content-ID" )
161- assert mail ._payload [1 ].__dict__ .get ("_headers" )[4 ][1 ] == msg .attachments [0 ][1 ]. get (
162- "headers"
163- ).get ("Content-Disposition" )
165+ assert mail ._payload [1 ].__dict__ .get ("_headers" )[3 ][1 ] == msg .attachments [0 ][
166+ 1
167+ ]. get ( "headers" ).get ("Content-ID" )
168+ assert mail ._payload [1 ].__dict__ .get ("_headers" )[4 ][1 ] == msg .attachments [0 ][
169+ 1
170+ ]. get ( "headers" ).get ("Content-Disposition" )
164171
165172 assert (
166173 mail ._payload [2 ].__dict__ .get ("_headers" )[3 ][1 ] == "attachment; "
@@ -184,7 +191,9 @@ async def test_jinja_message_list(mail_config):
184191 fm = FastMail (conf )
185192
186193 with fm .record_messages () as outbox :
187- await fm .send_message (message = msg , template_name = "array_iteration_jinja_template.html" )
194+ await fm .send_message (
195+ message = msg , template_name = "array_iteration_jinja_template.html"
196+ )
188197
189198 assert len (outbox ) == 1
190199 mail = outbox [0 ]
@@ -283,7 +292,9 @@ async def test_jinja_message_with_html(mail_config):
283292 )
284293 conf = ConnectionConfig (** mail_config )
285294 fm = FastMail (conf )
286- await fm .send_message (message = msg , template_name = "array_iteration_jinja_template.html" )
295+ await fm .send_message (
296+ message = msg , template_name = "array_iteration_jinja_template.html"
297+ )
287298
288299 assert msg .template_body == ("\n \n \n Andrej\n \n \n " )
289300
@@ -364,7 +375,10 @@ async def test_send_msg_with_alternative_body_and_attachements(mail_config):
364375
365376 assert mail ._payload [1 ].get_content_maintype () == "application"
366377
367- assert mail ._payload [1 ].__dict__ .get ("_headers" )[0 ][1 ] == "application/octet-stream"
378+ assert (
379+ mail ._payload [1 ].__dict__ .get ("_headers" )[0 ][1 ]
380+ == "application/octet-stream"
381+ )
368382
369383
370384@pytest .mark .asyncio
@@ -382,7 +396,6 @@ async def test_local_hostname_resolving(mail_config):
382396 assert session .session .local_hostname == conf .LOCAL_HOSTNAME
383397
384398
385-
386399@pytest .mark .asyncio
387400async def test_jinja_html_and_plain_message (mail_config ):
388401 sender = f"{ mail_config ['MAIL_FROM_NAME' ]} <{ mail_config ['MAIL_FROM' ]} >"
@@ -443,4 +456,3 @@ async def test_jinja_plain_and_html_message(mail_config):
443456 assert msg .subtype == MessageType .plain
444457 assert msg .template_body == "Andrej"
445458 assert msg .alternative_body == "<b>Andrej</b>"
446-
0 commit comments