diff --git a/python/tests/test_account.py b/python/tests/test_account.py index dc2e1c9ca..d1f97b918 100644 --- a/python/tests/test_account.py +++ b/python/tests/test_account.py @@ -204,6 +204,25 @@ class TestOfflineAccount: class TestOnlineAccount: + def test_one_account_init(self, acfactory): + ac1 = acfactory.get_online_configuring_account() + wait_successful_IMAP_SMTP_connection(ac1) + wait_configuration_progress(ac1, 1000) + + def test_one_account_send(self, acfactory): + ac1 = acfactory.get_online_configuring_account() + c2 = ac1.create_contact(email=ac1.get_config("addr")) + chat = ac1.create_chat_by_contact(c2) + assert chat.id >= const.DC_CHAT_ID_LAST_SPECIAL + #wait_successful_IMAP_SMTP_connection(ac1) + wait_configuration_progress(ac1, 1000) + + msg_out = chat.send_text("message2") + # wait for other account to receive + ev = ac1._evlogger.get_matching("DC_EVENT_INCOMING_MSG|DC_EVENT_MSGS_CHANGED") + assert ev[1] == msg_out.id + assert 0 + def test_forward_messages(self, acfactory): ac1 = acfactory.get_online_configuring_account() ac2 = acfactory.get_online_configuring_account() diff --git a/run-integration-tests.sh b/run-integration-tests.sh index 12633addc..00cbaaaff 100755 --- a/run-integration-tests.sh +++ b/run-integration-tests.sh @@ -25,7 +25,7 @@ fi pushd python toxargs="$@" if [ -e liveconfig ]; then - toxargs="--liveconfig liveconfig tests/ $@" + toxargs="--liveconfig liveconfig $@" fi tox -- $toxargs ret=$? diff --git a/src/smtp.rs b/src/smtp.rs index 85f172d90..901c9f90f 100644 --- a/src/smtp.rs +++ b/src/smtp.rs @@ -48,6 +48,16 @@ impl Smtp { /// Connect using the provided login params pub fn connect(&mut self, context: &Context, lp: *const dc_loginparam_t) -> usize { + warn!(context, 0, "SMTP ***************** CONNECT"); + unsafe { + dc_log_event( + context, + Event::INFO, + 0, + b"SMTP ***************************************************** connect starts" as *const u8 as *const libc::c_char, + ); + } + if lp.is_null() { return 0; } @@ -137,6 +147,15 @@ impl Smtp { .credentials(creds) .connection_reuse(lettre::smtp::ConnectionReuseParameters::ReuseUnlimited); self.transport = Some(client.transport()); + unsafe { + dc_log_event( + context, + Event::SMTP_CONNECTED, + 0, + b"SMTP-LOGIN ok" as *const u8 + as *const libc::c_char, + ); + } 1 } Err(err) => {