@@ -34,7 +34,9 @@ def test_2sa_required_email_notification(self) -> None:
3434 with vcr .use_cassette (os .path .join (self .vcr_path , "auth_requires_2fa.yml" )):
3535 with patch ("smtplib.SMTP" ) as smtp :
3636 # Pass fixed client ID via environment variable
37- runner = CliRunner (env = {"CLIENT_ID" : "EC5646DE-9423-11E8-BF21-14109FE0B321" })
37+ runner = CliRunner (
38+ env = {"CLIENT_ID" : "EC5646DE-9423-11E8-BF21-14109FE0B321" }
39+ )
3840 result = runner .invoke (
3941 main ,
4042 [
@@ -59,15 +61,17 @@ def test_2sa_required_email_notification(self) -> None:
5961 smtp_instance = smtp ()
6062 smtp_instance .connect .assert_called_once ()
6163 smtp_instance .starttls .assert_called_once ()
62- smtp_instance .login .assert_called_once_with ("jdoe+smtp@gmail.com" , "password1" )
64+ smtp_instance .login .assert_called_once_with (
65+ "jdoe+smtp@gmail.com" , "password1"
66+ )
6367 smtp_instance .sendmail .assert_called_once_with (
6468 "iCloud Photos Downloader <jdoe+smtp@gmail.com>" ,
6569 "jdoe+notifications@gmail.com" ,
6670 "From: iCloud Photos Downloader <jdoe+smtp@gmail.com>\n "
6771 "To: jdoe+notifications@gmail.com\n "
6872 "Subject: icloud_photos_downloader: Two step authentication has expired\n "
6973 "Date: 01/01/2018 00:00\n \n Hello,\n \n "
70- "Two -step authentication has expired for the icloud_photos_downloader script.\n "
74+ "jdoe@gmail.com's two -step authentication has expired for the icloud_photos_downloader script.\n "
7175 "Please log in to your server and run the script manually to update two-step "
7276 "authentication." ,
7377 )
@@ -84,7 +88,9 @@ def test_2sa_notification_without_smtp_login_and_tls(self) -> None:
8488 with vcr .use_cassette (os .path .join (self .vcr_path , "auth_requires_2fa.yml" )):
8589 with patch ("smtplib.SMTP" ) as smtp :
8690 # Pass fixed client ID via environment variable
87- runner = CliRunner (env = {"CLIENT_ID" : "EC5646DE-9423-11E8-BF21-14109FE0B321" })
91+ runner = CliRunner (
92+ env = {"CLIENT_ID" : "EC5646DE-9423-11E8-BF21-14109FE0B321" }
93+ )
8894 result = runner .invoke (
8995 main ,
9096 [
@@ -114,7 +120,7 @@ def test_2sa_notification_without_smtp_login_and_tls(self) -> None:
114120 "To: jdoe+notifications@gmail.com\n "
115121 "Subject: icloud_photos_downloader: Two step authentication has expired\n "
116122 "Date: 01/01/2018 00:00\n \n Hello,\n \n "
117- "Two -step authentication has expired for the icloud_photos_downloader script.\n "
123+ "jdoe@gmail.com's two -step authentication has expired for the icloud_photos_downloader script.\n "
118124 "Please log in to your server and run the script manually to update two-step "
119125 "authentication." ,
120126 )
@@ -131,7 +137,9 @@ def test_2sa_required_notification_script(self) -> None:
131137 with vcr .use_cassette (os .path .join (self .vcr_path , "auth_requires_2fa.yml" )):
132138 with patch ("subprocess.call" ) as subprocess_patched :
133139 # Pass fixed client ID via environment variable
134- runner = CliRunner (env = {"CLIENT_ID" : "EC5646DE-9423-11E8-BF21-14109FE0B321" })
140+ runner = CliRunner (
141+ env = {"CLIENT_ID" : "EC5646DE-9423-11E8-BF21-14109FE0B321" }
142+ )
135143 result = runner .invoke (
136144 main ,
137145 [
@@ -163,7 +171,9 @@ def test_2sa_required_email_notification_from(self) -> None:
163171 with vcr .use_cassette (os .path .join (self .vcr_path , "auth_requires_2fa.yml" )):
164172 with patch ("smtplib.SMTP" ) as smtp :
165173 # Pass fixed client ID via environment variable
166- runner = CliRunner (env = {"CLIENT_ID" : "EC5646DE-9423-11E8-BF21-14109FE0B321" })
174+ runner = CliRunner (
175+ env = {"CLIENT_ID" : "EC5646DE-9423-11E8-BF21-14109FE0B321" }
176+ )
167177 result = runner .invoke (
168178 main ,
169179 [
@@ -190,15 +200,17 @@ def test_2sa_required_email_notification_from(self) -> None:
190200 smtp_instance = smtp ()
191201 smtp_instance .connect .assert_called_once ()
192202 smtp_instance .starttls .assert_called_once ()
193- smtp_instance .login .assert_called_once_with ("jdoe+smtp@gmail.com" , "password1" )
203+ smtp_instance .login .assert_called_once_with (
204+ "jdoe+smtp@gmail.com" , "password1"
205+ )
194206 smtp_instance .sendmail .assert_called_once_with (
195207 "JD <jdoe+notifications+from@gmail.com>" ,
196208 "JD <jdoe+notifications@gmail.com>" ,
197209 "From: JD <jdoe+notifications+from@gmail.com>\n "
198210 "To: JD <jdoe+notifications@gmail.com>\n "
199211 "Subject: icloud_photos_downloader: Two step authentication has expired\n "
200212 "Date: 01/01/2018 00:00\n \n Hello,\n \n "
201- "Two -step authentication has expired for the icloud_photos_downloader script.\n "
213+ "jdoe@gmail.com's two -step authentication has expired for the icloud_photos_downloader script.\n "
202214 "Please log in to your server and run the script manually to update two-step "
203215 "authentication." ,
204216 )
0 commit comments