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

@@ -38,7 +38,7 @@ class Account(object):
# initialize per-account plugin system
self._pm = hookspec.PerAccount._make_plugin_manager()
self._logging = logging
self.logid=logid
self.logid = logid
self.add_account_plugin(self)
@@ -631,7 +631,7 @@ class Account(object):
hook = hookspec.Global._get_plugin_manager().hook
hook.dc_account_after_shutdown(account=self)
self.log("shutdown finished")
class ScannedQRCode:
def __init__(self, dc_lot):

View File

@@ -29,7 +29,7 @@ class ImapConn():
messages = self.reselect_folder()
try:
self.original_msg_count = int(messages[0])
print("dbg", str(messages))
print("dbg", str(messages))
except IndexError:
self.original_msg_count = 0
@@ -80,13 +80,13 @@ class ImapConn():
def __del__(self):
try:
self.connection.close()
except:
pass
except Exception:
print("Could not close direct_imap conn")
try:
self.connection.logout()
except:
pass
except Exception:
print("Could not logout direct_imap conn")
def make_direct_imap(account, folder):
conn_info = (account.get_config("configured_mail_server"),
@@ -94,9 +94,11 @@ def make_direct_imap(account, folder):
imap = ImapConn(folder, conn_info=conn_info)
return imap
def print_imap_structure(database, dir="."):
print_imap_structure_ac(Account(database), dir)
def print_imap_structure_ac(ac, dir="."):
acinfo = ac.logid + "-" + ac.get_config("addr")
print("================= ACCOUNT", acinfo, "=================")

View File

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

View File

@@ -647,7 +647,7 @@ class TestOnlineAccount:
ac2.start_io()
imap2 = make_direct_imap(ac2, direct_imap.MVBOX)
#imap2.mark_all_read()
# imap2.mark_all_read()
assert imap2.get_unread_cnt() == 0
chat = self.get_chat(ac1, ac2)
@@ -679,8 +679,6 @@ class TestOnlineAccount:
time.sleep(1) # We might need to wait because Imaplib is slower than DC-Core
assert imap2.get_unread_cnt() == 0
#print_imap_structure(ac1.db_path)
def test_mark_bcc_read_on_server(self, acfactory, lp):
ac1 = acfactory.get_online_configuring_account(mvbox=True, move=True)
ac2 = acfactory.get_online_configuring_account()
@@ -691,7 +689,7 @@ class TestOnlineAccount:
ac2.start_io()
imap1 = make_direct_imap(ac1, direct_imap.MVBOX)
#imap1.mark_all_read()
# imap1.mark_all_read()
assert imap1.get_unread_cnt() == 0
chat = self.get_chat(ac1, ac2)
@@ -712,8 +710,6 @@ class TestOnlineAccount:
break
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
def test_send_file_twice_unicode_filename_mangling(self, tmpdir, acfactory, lp):