From d97d9980dd84cfd976a8f26667caeafa51f9e33c Mon Sep 17 00:00:00 2001 From: holger krekel Date: Fri, 5 Jun 2020 23:12:05 +0200 Subject: [PATCH] cleanup --- python/src/deltachat/direct_imap.py | 14 +++++++------- python/tests/test_account.py | 2 -- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/python/src/deltachat/direct_imap.py b/python/src/deltachat/direct_imap.py index 2328d4a08..f396bb8f8 100644 --- a/python/src/deltachat/direct_imap.py +++ b/python/src/deltachat/direct_imap.py @@ -14,23 +14,23 @@ def db_folder_attr(name): class ImapConn: def __init__(self, account): self.account = account - host = account.get_config("configured_mail_server"), - user = account.get_config("addr"), - pw = account.get_config("mail_pw")) + host = account.get_config("configured_mail_server") + user = account.get_config("addr") + pw = account.get_config("mail_pw") self.connection = imaplib.IMAP4_SSL(host) self.connection.login(user, pw) self._original_msg_count = {} self.select_folder("INBOX") def shutdown(self): - try: - self.connection.logout() - except Exception: - print("Could not logout direct_imap conn") try: self.connection.close() except Exception: pass + try: + self.connection.logout() + except Exception: + print("Could not logout direct_imap conn") def select_folder(self, foldername): status, messages = self.connection.select(foldername) diff --git a/python/tests/test_account.py b/python/tests/test_account.py index 896388e7e..4e5b9066e 100644 --- a/python/tests/test_account.py +++ b/python/tests/test_account.py @@ -1505,11 +1505,9 @@ class TestOnlineAccount: ac1._evtracker.get_matching("DC_EVENT_SMTP_MESSAGE_SENT") lp.sec("ac2: wait for incoming location message") - # ac2._evtracker.get_matching("DC_EVENT_INCOMING_MSG") # "enabled-location streaming" # currently core emits location changed before event_incoming message ac2._evtracker.get_matching("DC_EVENT_LOCATION_CHANGED") - # ac2._evtracker.get_matching("DC_EVENT_INCOMING_MSG") # text message with location locations = chat2.get_locations() assert len(locations) == 1