PEP8 enhancement
This commit is contained in:
1 parent
a0bbd7885a
commit
a8703270da
1 file changed
+5
-10
@@ -29,6 +29,7 @@ from gluon.http import HTTP
|
|||||||
python_version = sys.version[:3]
|
python_version = sys.version[:3]
|
||||||
IS_IMAP = "imap" in DEFAULT_URI
|
IS_IMAP = "imap" in DEFAULT_URI
|
||||||
|
|
||||||
|
|
||||||
@unittest.skipIf(IS_IMAP, "TODO: Imap raises 'Connection refused'")
|
@unittest.skipIf(IS_IMAP, "TODO: Imap raises 'Connection refused'")
|
||||||
class TestAuth(unittest.TestCase):
|
class TestAuth(unittest.TestCase):
|
||||||
|
|
||||||
@@ -102,7 +103,7 @@ class TestMail(unittest.TestCase):
|
|||||||
users = {}
|
users = {}
|
||||||
|
|
||||||
def __init__(self, address, port, **kwargs):
|
def __init__(self, address, port, **kwargs):
|
||||||
self.address=address
|
self.address = address
|
||||||
self.port = port
|
self.port = port
|
||||||
self.has_quit = False
|
self.has_quit = False
|
||||||
self.tls = False
|
self.tls = False
|
||||||
@@ -110,14 +111,14 @@ class TestMail(unittest.TestCase):
|
|||||||
def login(self, username, password):
|
def login(self, username, password):
|
||||||
if username not in self.users or self.users[username] != password:
|
if username not in self.users or self.users[username] != password:
|
||||||
raise smtplib.SMTPAuthenticationError
|
raise smtplib.SMTPAuthenticationError
|
||||||
self.username=username
|
self.username = username
|
||||||
self.password=password
|
self.password = password
|
||||||
|
|
||||||
def sendmail(self, sender, to, payload):
|
def sendmail(self, sender, to, payload):
|
||||||
self.inbox.append(TestMail.Message(sender, to, payload))
|
self.inbox.append(TestMail.Message(sender, to, payload))
|
||||||
|
|
||||||
def quit(self):
|
def quit(self):
|
||||||
self.has_quit=True
|
self.has_quit = True
|
||||||
|
|
||||||
def ehlo(self, hostname=None):
|
def ehlo(self, hostname=None):
|
||||||
pass
|
pass
|
||||||
@@ -125,7 +126,6 @@ class TestMail(unittest.TestCase):
|
|||||||
def starttls(self):
|
def starttls(self):
|
||||||
self.tls = True
|
self.tls = True
|
||||||
|
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.original_SMTP = smtplib.SMTP
|
self.original_SMTP = smtplib.SMTP
|
||||||
self.original_SMTP_SSL = smtplib.SMTP_SSL
|
self.original_SMTP_SSL = smtplib.SMTP_SSL
|
||||||
@@ -213,10 +213,5 @@ class TestMail(unittest.TestCase):
|
|||||||
message='world'))
|
message='world'))
|
||||||
TestMail.DummySMTP.inbox.pop()
|
TestMail.DummySMTP.inbox.pop()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
Reference in new issue
Block a user