This commit is contained in:
Hocuri
2020-05-28 21:26:39 +02:00
parent 5677bf3fe5
commit d66b6acde4
4 changed files with 12 additions and 16 deletions

View File

@@ -80,12 +80,12 @@ class ImapConn():
def __del__(self): def __del__(self):
try: try:
self.connection.close() self.connection.close()
except: except Exception:
pass print("Could not close direct_imap conn")
try: try:
self.connection.logout() self.connection.logout()
except: except Exception:
pass print("Could not logout direct_imap conn")
def make_direct_imap(account, folder): def make_direct_imap(account, folder):
@@ -94,9 +94,11 @@ def make_direct_imap(account, folder):
imap = ImapConn(folder, conn_info=conn_info) imap = ImapConn(folder, conn_info=conn_info)
return imap return imap
def print_imap_structure(database, dir="."): def print_imap_structure(database, dir="."):
print_imap_structure_ac(Account(database), dir) print_imap_structure_ac(Account(database), dir)
def print_imap_structure_ac(ac, dir="."): def print_imap_structure_ac(ac, dir="."):
acinfo = ac.logid + "-" + ac.get_config("addr") acinfo = ac.logid + "-" + ac.get_config("addr")
print("================= ACCOUNT", acinfo, "=================") print("================= ACCOUNT", acinfo, "=================")

View File

@@ -17,8 +17,6 @@ from .capi import lib
from .events import FFIEventLogger, FFIEventTracker from .events import FFIEventLogger, FFIEventTracker
from _pytest._code import Source from _pytest._code import Source
from .direct_imap import ImapConn
import deltachat import deltachat

View File

@@ -679,8 +679,6 @@ class TestOnlineAccount:
time.sleep(1) # We might need to wait because Imaplib is slower than DC-Core time.sleep(1) # We might need to wait because Imaplib is slower than DC-Core
assert imap2.get_unread_cnt() == 0 assert imap2.get_unread_cnt() == 0
#print_imap_structure(ac1.db_path)
def test_mark_bcc_read_on_server(self, acfactory, lp): def test_mark_bcc_read_on_server(self, acfactory, lp):
ac1 = acfactory.get_online_configuring_account(mvbox=True, move=True) ac1 = acfactory.get_online_configuring_account(mvbox=True, move=True)
ac2 = acfactory.get_online_configuring_account() ac2 = acfactory.get_online_configuring_account()
@@ -712,8 +710,6 @@ class TestOnlineAccount:
break break
time.sleep(1) # We might need to wait because Imaplib is slower than DC-Core time.sleep(1) # We might need to wait because Imaplib is slower than DC-Core
#print_imap_structure(ac1.db_path)
assert imap1.get_unread_cnt() == 0 assert imap1.get_unread_cnt() == 0
def test_send_file_twice_unicode_filename_mangling(self, tmpdir, acfactory, lp): def test_send_file_twice_unicode_filename_mangling(self, tmpdir, acfactory, lp):