From 7d4affcc8d6365f800a67ea1bcab038ad5ee8052 Mon Sep 17 00:00:00 2001 From: link2xt Date: Sat, 22 May 2021 15:54:15 +0300 Subject: [PATCH] python: disable BCC-self in `test_markseen_message_and_mdn` This test checks that MDN is marked as seen on ac1. Because ac1 also receives BCC-self, it is possible that event of marking this message as seen is confused with marking MDN as seen, and the test passes even if MDN is not marked as seen. Explicitly disabling BCC-self for ac1 ensures it receives only one message (MDN). Also start direct_imap as early as possible, before sending the message. It is possible now, because BCC-self is not sent. --- python/tests/test_account.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/python/tests/test_account.py b/python/tests/test_account.py index 81dd42298..243a91d7b 100644 --- a/python/tests/test_account.py +++ b/python/tests/test_account.py @@ -1071,10 +1071,10 @@ class TestOnlineAccount: # We had so many problems with markseen, if in doubt, rather create another test, it can't harm. ac1 = acfactory.get_online_configuring_account(move=mvbox_move, mvbox=mvbox_move) ac2 = acfactory.get_online_configuring_account(move=mvbox_move, mvbox=mvbox_move) - acfactory.wait_configure_and_start_io() - acfactory.get_accepted_chat(ac1, ac2).send_text("hi") - msg = ac2._evtracker.wait_next_incoming_message() + acfactory.wait_configure_and_start_io() + # Do not send BCC to self, we only want to test MDN on ac1. + ac1.set_config("bcc_self", "0") folder = "mvbox" if mvbox_move else "inbox" ac1.direct_imap.select_config_folder(folder) @@ -1082,6 +1082,9 @@ class TestOnlineAccount: ac1.direct_imap.idle_start() ac2.direct_imap.idle_start() + acfactory.get_accepted_chat(ac1, ac2).send_text("hi") + msg = ac2._evtracker.wait_next_incoming_message() + ac2.mark_seen_messages([msg]) ac1.direct_imap.idle_wait_for_seen() # Check that the mdn is marked as seen