示例#1
0
    def update_thread(self):
        from azure.communication.chat import ChatThreadClient
        from azure.communication.chat import CommunicationUserCredential
        chat_thread_client = ChatThreadClient(
            self.endpoint, CommunicationUserCredential(self.token),
            self._thread_id)
        # [START update_thread]
        topic = "updated thread topic"
        chat_thread_client.update_thread(topic=topic)
        # [END update_thread]

        print("update_chat_thread succeeded")
    def update_thread(self):
        from azure.communication.chat import ChatThreadClient
        from azure.communication.chat import CommunicationTokenCredential, CommunicationTokenRefreshOptions
        refresh_options = CommunicationTokenRefreshOptions(self.token)
        chat_thread_client = ChatThreadClient(
            self.endpoint, CommunicationTokenCredential(refresh_options),
            self._thread_id)
        # [START update_thread]
        topic = "updated thread topic"
        chat_thread_client.update_thread(topic=topic)
        # [END update_thread]

        print("update_chat_thread succeeded")
示例#3
0
    def test_update_thread(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))

        topic = "update topic"
        try:
            chat_thread_client.update_thread(topic=topic)
        except:
            raised = True

        self.assertFalse(raised, 'Expected is no excpetion raised')