def send_typing_notification(self): from azure.communication.chat import ChatThreadClient, CommunicationTokenCredential, CommunicationTokenRefreshOptions refresh_options = CommunicationTokenRefreshOptions(self.token) chat_thread_client = ChatThreadClient(self.endpoint, CommunicationTokenCredential(refresh_options), self._thread_id) # [START send_typing_notification] chat_thread_client.send_typing_notification() # [END send_typing_notification] print("send_typing_notification succeeded")
def send_typing_notification(self): from azure.communication.chat import ChatThreadClient, CommunicationUserCredential chat_thread_client = ChatThreadClient( self.endpoint, CommunicationUserCredential(self.token), self._thread_id) # [START send_typing_notification] chat_thread_client.send_typing_notification() # [END send_typing_notification] print("send_typing_notification succeeded")
def test_send_typing_notification(self): thread_id = "19:[email protected]" raised = False def mock_send(*_, **__): return mock_response(status_code=200) chat_thread_client = ChatThreadClient("https://endpoint", TestChatThreadClient.credential, thread_id, transport=Mock(send=mock_send)) try: chat_thread_client.send_typing_notification() except: raised = True self.assertFalse(raised, 'Expected is no excpetion raised')