@@ -9,6 +9,7 @@ def test_calls(acfactory) -> None:
99
1010 alice_contact_bob = alice .create_contact (bob , "Bob" )
1111 alice_chat_bob = alice_contact_bob .create_chat ()
12+ bob .create_chat (alice ) # Accept the chat so incoming call causes a notification.
1213 outgoing_call_message = alice_chat_bob .place_outgoing_call (place_call_info )
1314 assert outgoing_call_message .get_call_info ().state .kind == "Alerting"
1415
@@ -67,6 +68,7 @@ def test_video_call(acfactory) -> None:
6768
6869 alice , bob = acfactory .get_online_accounts (2 )
6970
71+ bob .create_chat (alice ) # Accept the chat so incoming call causes a notification.
7072 alice_contact_bob = alice .create_contact (bob , "Bob" )
7173 alice_chat_bob = alice_contact_bob .create_chat ()
7274 alice_chat_bob .place_outgoing_call (place_call_info )
@@ -84,3 +86,24 @@ def test_ice_servers(acfactory) -> None:
8486
8587 ice_servers = alice .ice_servers ()
8688 assert len (ice_servers ) == 1
89+
90+
91+ def test_no_contact_request_call (acfactory ) -> None :
92+ alice , bob = acfactory .get_online_accounts (2 )
93+
94+ alice_chat_bob = alice .create_chat (bob )
95+ alice_chat_bob .place_outgoing_call ("offer" )
96+ alice_chat_bob .send_text ("Hello!" )
97+
98+ # Notification for "Hello!" message should arrive
99+ # without the call ringing.
100+ while True :
101+ event = bob .wait_for_event ()
102+
103+ # There should be no incoming call notification.
104+ assert event .kind != EventType .INCOMING_CALL
105+
106+ if event .kind == EventType .INCOMING_MSG :
107+ msg = bob .get_message_by_id (event .msg_id )
108+ assert msg .get_snapshot ().text == "Hello!"
109+ break
0 commit comments