Skip to content

Commit 3e8987b

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

File tree

2 files changed

+24
-17
lines changed

2 files changed

+24
-17
lines changed

deltachat-rpc-client/tests/test_something.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,3 +801,27 @@ 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+
ac1 = acfactory.new_configured_account()
809+
ac1.set_config("mvbox_move", "1")
810+
ac1.bring_online()
811+
812+
ac1_direct_imap = direct_imap(ac1)
813+
ac1_direct_imap.conn.folder.delete("DeltaChat")
814+
assert "DeltaChat" not in ac1_direct_imap.list_folders()
815+
816+
# Wait until new folder is created and UIDVALIDITY is updated.
817+
while True:
818+
event = ac1.wait_for_event()
819+
if event.kind == EventType.INFO and "uid/validity change folder DeltaChat" in event.msg:
820+
break
821+
822+
ac2 = acfactory.get_online_account()
823+
ac2.create_chat(ac1).send_text("hello")
824+
msg = ac1.wait_for_incoming_msg().get_snapshot()
825+
assert msg.text == "hello"
826+
827+
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.

0 commit comments

Comments
 (0)