mirror of
https://github.com/chatmail/core.git
synced 2026-05-19 23:06:32 +03:00
fix some test flakyness
This commit is contained in:
@@ -61,8 +61,10 @@ def set_context_callback(dc_context, func):
|
|||||||
|
|
||||||
|
|
||||||
def clear_context_callback(dc_context):
|
def clear_context_callback(dc_context):
|
||||||
_DC_CALLBACK_MAP.pop(dc_context, None)
|
try:
|
||||||
|
_DC_CALLBACK_MAP.pop(dc_context, None)
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
|
|
||||||
def get_dc_event_name(integer, _DC_EVENTNAME_MAP={}):
|
def get_dc_event_name(integer, _DC_EVENTNAME_MAP={}):
|
||||||
if not _DC_EVENTNAME_MAP:
|
if not _DC_EVENTNAME_MAP:
|
||||||
|
|||||||
@@ -32,7 +32,11 @@ class TestInCreation:
|
|||||||
chat2.add_contact(c2)
|
chat2.add_contact(c2)
|
||||||
wait_msgs_changed(ac1, 0, 0) # why not chat id?
|
wait_msgs_changed(ac1, 0, 0) # why not chat id?
|
||||||
ac1.forward_messages([prepared_original], chat2)
|
ac1.forward_messages([prepared_original], chat2)
|
||||||
|
# XXX there might be two EVENT_MSGS_CHANGED and only one of them
|
||||||
|
# is the one caused by forwarding
|
||||||
forwarded_id = wait_msgs_changed(ac1, chat2.id)
|
forwarded_id = wait_msgs_changed(ac1, chat2.id)
|
||||||
|
if forwarded_id == 0:
|
||||||
|
forwarded_id = wait_msgs_changed(ac1, chat2.id)
|
||||||
forwarded_msg = ac1.get_message_by_id(forwarded_id)
|
forwarded_msg = ac1.get_message_by_id(forwarded_id)
|
||||||
assert forwarded_msg.get_state().is_out_preparing()
|
assert forwarded_msg.get_state().is_out_preparing()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user