def remove_member(self): from azure.communication.chat import ChatThreadClient from azure.communication.chat import CommunicationUserCredential, CommunicationUser chat_thread_client = ChatThreadClient( self.endpoint, CommunicationUserCredential(self.token), self._thread_id) # [START remove_member] chat_thread_client.remove_member(self.new_user) # [END remove_member] print("remove_chat_member succeeded")
def test_remove_member(self): thread_id = "19:[email protected]" member_id="8:acs:57b9bac9-df6c-4d39-a73b-26e944adf6ea_9b0110-08007f1041" raised = False def mock_send(*_, **__): return mock_response(status_code=204) chat_thread_client = ChatThreadClient("https://endpoint", TestChatThreadClient.credential, thread_id, transport=Mock(send=mock_send)) try: chat_thread_client.remove_member(CommunicationUserIdentifier(member_id)) except: raised = True self.assertFalse(raised, 'Expected is no excpetion raised')