Skip to content

Commit 0213cc3

Browse files
committed
test: port test_delete_deltachat_folder to JSON-RPC
1 parent 634cbd1 commit 0213cc3

File tree

3 files changed

+27
-17
lines changed

3 files changed

+27
-17
lines changed

deltachat-rpc-client/tests/test_something.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,3 +801,29 @@ def test_get_all_accounts_deadlock(rpc):
801801
all_accounts = rpc.get_all_accounts.future()
802802
rpc.add_account()
803803
all_accounts()
804+
805+
806+
def test_delete_deltachat_folder(acfactory, direct_imap):
807+
"""Test that DeltaChat folder is recreated if user deletes it manually."""
808+
addr, password = acfactory.get_credentials()
809+
ac1 = acfactory.get_unconfigured_account()
810+
ac1.add_transport({"addr": addr, "password": password})
811+
ac1.set_config("mvbox_move", "1")
812+
ac1.bring_online()
813+
814+
ac1_direct_imap = direct_imap(ac1)
815+
ac1_direct_imap.conn.folder.delete("DeltaChat")
816+
assert "DeltaChat" not in ac1_direct_imap.list_folders()
817+
818+
# Wait until new folder is created and UIDVALIDITY is updated.
819+
while True:
820+
event = ac1.wait_for_event()
821+
if event.kind == EventType.INFO and "uid/validity change folder DeltaChat" in event.msg:
822+
break
823+
824+
ac2 = acfactory.get_online_account()
825+
ac2.create_chat(ac1).send_text("hello")
826+
msg = ac1.wait_for_incoming_msg().get_snapshot()
827+
assert msg.text == "hello"
828+
829+
assert "DeltaChat" in ac1_direct_imap.list_folders()

python/tests/test_1_online.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1979,23 +1979,6 @@ def test_scan_folders(acfactory, lp, folder, move, expected_destination):
19791979
assert len(ac1.direct_imap.get_all_messages()) == 0
19801980

19811981

1982-
def test_delete_deltachat_folder(acfactory):
1983-
"""Test that DeltaChat folder is recreated if user deletes it manually."""
1984-
ac1 = acfactory.new_online_configuring_account(mvbox_move=True)
1985-
ac2 = acfactory.new_online_configuring_account()
1986-
acfactory.wait_configured(ac1)
1987-
1988-
ac1.direct_imap.conn.folder.delete("DeltaChat")
1989-
assert "DeltaChat" not in ac1.direct_imap.list_folders()
1990-
acfactory.bring_accounts_online()
1991-
1992-
ac2.create_chat(ac1).send_text("hello")
1993-
msg = ac1._evtracker.wait_next_incoming_message()
1994-
assert msg.text == "hello"
1995-
1996-
assert "DeltaChat" in ac1.direct_imap.list_folders()
1997-
1998-
19991982
def test_archived_muted_chat(acfactory, lp):
20001983
"""If an archived and muted chat receives a new message, DC_EVENT_MSGS_CHANGED for
20011984
DC_CHAT_ID_ARCHIVED_LINK must be generated if the chat had only seen messages previously.

src/imap/select_folder.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ impl ImapSession {
247247
old_uid_next,
248248
old_uid_validity,
249249
);
250+
250251
Ok(true)
251252
}
252253
}

0 commit comments

Comments
 (0)