test: get_protected_chat(): Use FFIEventTracker instead of dc_wait_next_msgs() (#5207)

The way it was implemented it threw out all remaining messages after finding the next incoming
message. Better use FFIEventTracker functions, they are used in all the tests anyway.
This commit is contained in:
iequidoo
2024-03-01 16:12:20 -03:00
committed by iequidoo
parent ecfe3898c6
commit e16322d99d
4 changed files with 16 additions and 34 deletions

View File

@@ -182,6 +182,12 @@ class FFIEventTracker:
print(f"** SECUREJOINT-INVITER PROGRESS {target}", self.account)
break
def wait_securejoin_joiner_progress(self, target):
while True:
event = self.get_matching("DC_EVENT_SECUREJOIN_JOINER_PROGRESS")
if event.data2 >= target:
break
def wait_idle_inbox_ready(self):
"""Has to be called after start_io() to wait for fetch_existing_msgs to run
so that new messages are not mistaken for old ones: