You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/mail.py
+2-24Lines changed: 2 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -31,19 +31,13 @@
31
31
importmock
32
32
importlogging
33
33
importsys
34
-
frommock.mockimportMagicMock
35
-
36
-
ifsys.version_info[0] >=3:
37
-
fromunittest.mockimportmock_open
38
-
elifsys.version_info[0] >=2:
39
-
frommockimportmock_open
40
34
41
35
fromvsc.install.testingimportTestCase
42
36
43
37
fromemail.mime.textimportMIMEText
44
38
fromvsc.utils.mailimportVscMail
45
39
46
-
classTestVscMailConfig(TestCase):
40
+
classTestVscMail(TestCase):
47
41
48
42
49
43
deftest_config_file(self):
@@ -64,21 +58,7 @@ def test_config_file(self):
64
58
self.assertEqual(mail.mail_host, mail_host)
65
59
self.assertEqual(mail.mail_port, mail_port)
66
60
67
-
cfgfile="""
68
-
[main]
69
-
mail_host = config_host
70
-
mail_port = 789
71
-
smtp_auth_user = config_user
72
-
smtp_auth_password = config_passwd
73
-
smtp_use_starttls = 1
74
-
"""
75
-
# based on https://stackoverflow.com/questions/1289894/how-do-i-mock-an-open-used-in-a-with-statement-using-the-mock-framework-in-pyth/34677735#34677735
0 commit comments