From 108c8efb1ec62e1079a87284d9be0570cf6ab756 Mon Sep 17 00:00:00 2001 From: Jorge Beauregard <69869951+jbeauregardb@users.noreply.github.com> Date: Wed, 17 Feb 2021 17:08:44 -0600 Subject: [PATCH] Fixed chat tests issue token renaming issue (#16786) --- sdk/communication/azure-communication-chat/README.md | 2 +- .../azure-communication-chat/samples/chat_client_sample.py | 2 +- .../samples/chat_client_sample_async.py | 2 +- .../samples/chat_thread_client_sample.py | 2 +- .../samples/chat_thread_client_sample_async.py | 2 +- .../azure-communication-chat/tests/test_chat_client_e2e.py | 2 +- .../tests/test_chat_client_e2e_async.py | 2 +- .../tests/test_chat_thread_client_e2e.py | 4 ++-- .../tests/test_chat_thread_client_e2e_async.py | 4 ++-- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/sdk/communication/azure-communication-chat/README.md b/sdk/communication/azure-communication-chat/README.md index c5468fc8d877..bff18e82150c 100644 --- a/sdk/communication/azure-communication-chat/README.md +++ b/sdk/communication/azure-communication-chat/README.md @@ -32,7 +32,7 @@ pip install --pre azure-communication-identity from azure.communication.identity import CommunicationIdentityClient identity_client = CommunicationIdentityClient.from_connection_string("") user = identity_client.create_user() -tokenresponse = identity_client.issue_token(user, scopes=["chat"]) +tokenresponse = identity_client.get_token(user, scopes=["chat"]) token = tokenresponse.token ``` diff --git a/sdk/communication/azure-communication-chat/samples/chat_client_sample.py b/sdk/communication/azure-communication-chat/samples/chat_client_sample.py index ac7fb0062477..c5884f31a035 100644 --- a/sdk/communication/azure-communication-chat/samples/chat_client_sample.py +++ b/sdk/communication/azure-communication-chat/samples/chat_client_sample.py @@ -34,7 +34,7 @@ class ChatClientSamples(object): identity_client = CommunicationIdentityClient.from_connection_string(connection_string) user = identity_client.create_user() - tokenresponse = identity_client.issue_token(user, scopes=["chat"]) + tokenresponse = identity_client.get_token(user, scopes=["chat"]) token = tokenresponse.token endpoint = os.environ.get("AZURE_COMMUNICATION_SERVICE_ENDPOINT", None) diff --git a/sdk/communication/azure-communication-chat/samples/chat_client_sample_async.py b/sdk/communication/azure-communication-chat/samples/chat_client_sample_async.py index 6a8df4addb8e..f9d7503fa098 100644 --- a/sdk/communication/azure-communication-chat/samples/chat_client_sample_async.py +++ b/sdk/communication/azure-communication-chat/samples/chat_client_sample_async.py @@ -34,7 +34,7 @@ class ChatClientSamplesAsync(object): identity_client = CommunicationIdentityClient.from_connection_string(connection_string) user = identity_client.create_user() - tokenresponse = identity_client.issue_token(user, scopes=["chat"]) + tokenresponse = identity_client.get_token(user, scopes=["chat"]) token = tokenresponse.token endpoint = os.environ.get("AZURE_COMMUNICATION_SERVICE_ENDPOINT", None) diff --git a/sdk/communication/azure-communication-chat/samples/chat_thread_client_sample.py b/sdk/communication/azure-communication-chat/samples/chat_thread_client_sample.py index 5ee180aea894..2dcd11236147 100644 --- a/sdk/communication/azure-communication-chat/samples/chat_thread_client_sample.py +++ b/sdk/communication/azure-communication-chat/samples/chat_thread_client_sample.py @@ -34,7 +34,7 @@ class ChatThreadClientSamples(object): identity_client = CommunicationIdentityClient.from_connection_string(connection_string) user = identity_client.create_user() - tokenresponse = identity_client.issue_token(user, scopes=["chat"]) + tokenresponse = identity_client.get_token(user, scopes=["chat"]) token = tokenresponse.token endpoint = os.environ.get("AZURE_COMMUNICATION_SERVICE_ENDPOINT", None) diff --git a/sdk/communication/azure-communication-chat/samples/chat_thread_client_sample_async.py b/sdk/communication/azure-communication-chat/samples/chat_thread_client_sample_async.py index 2d70572bc3cb..58d5aaa2eb51 100644 --- a/sdk/communication/azure-communication-chat/samples/chat_thread_client_sample_async.py +++ b/sdk/communication/azure-communication-chat/samples/chat_thread_client_sample_async.py @@ -35,7 +35,7 @@ class ChatThreadClientSamplesAsync(object): identity_client = CommunicationIdentityClient.from_connection_string(connection_string) user = identity_client.create_user() - tokenresponse = identity_client.issue_token(user, scopes=["chat"]) + tokenresponse = identity_client.get_token(user, scopes=["chat"]) token = tokenresponse.token endpoint = os.environ.get("AZURE_COMMUNICATION_SERVICE_ENDPOINT", None) diff --git a/sdk/communication/azure-communication-chat/tests/test_chat_client_e2e.py b/sdk/communication/azure-communication-chat/tests/test_chat_client_e2e.py index c57f10713c36..92877aa72f92 100644 --- a/sdk/communication/azure-communication-chat/tests/test_chat_client_e2e.py +++ b/sdk/communication/azure-communication-chat/tests/test_chat_client_e2e.py @@ -46,7 +46,7 @@ def setUp(self): # create user and issue token self.user = self.identity_client.create_user() - tokenresponse = self.identity_client.issue_token(self.user, scopes=["chat"]) + tokenresponse = self.identity_client.get_token(self.user, scopes=["chat"]) self.token = tokenresponse.token # create ChatClient diff --git a/sdk/communication/azure-communication-chat/tests/test_chat_client_e2e_async.py b/sdk/communication/azure-communication-chat/tests/test_chat_client_e2e_async.py index a71e749a2090..a9af97f0a116 100644 --- a/sdk/communication/azure-communication-chat/tests/test_chat_client_e2e_async.py +++ b/sdk/communication/azure-communication-chat/tests/test_chat_client_e2e_async.py @@ -44,7 +44,7 @@ def setUp(self): # create user self.user = self.identity_client.create_user() - token_response = self.identity_client.issue_token(self.user, scopes=["chat"]) + token_response = self.identity_client.get_token(self.user, scopes=["chat"]) self.token = token_response.token # create ChatClient diff --git a/sdk/communication/azure-communication-chat/tests/test_chat_thread_client_e2e.py b/sdk/communication/azure-communication-chat/tests/test_chat_thread_client_e2e.py index 9bebfb355fcf..536267bc08fd 100644 --- a/sdk/communication/azure-communication-chat/tests/test_chat_thread_client_e2e.py +++ b/sdk/communication/azure-communication-chat/tests/test_chat_thread_client_e2e.py @@ -45,12 +45,12 @@ def setUp(self): # create user and issue token self.user = self.identity_client.create_user() - tokenresponse = self.identity_client.issue_token(self.user, scopes=["chat"]) + tokenresponse = self.identity_client.get_token(self.user, scopes=["chat"]) self.token = tokenresponse.token # create another user self.new_user = self.identity_client.create_user() - tokenresponse = self.identity_client.issue_token(self.new_user, scopes=["chat"]) + tokenresponse = self.identity_client.get_token(self.new_user, scopes=["chat"]) self.token_new_user = tokenresponse.token # create ChatClient diff --git a/sdk/communication/azure-communication-chat/tests/test_chat_thread_client_e2e_async.py b/sdk/communication/azure-communication-chat/tests/test_chat_thread_client_e2e_async.py index cacbcff1ed12..6245f8733702 100644 --- a/sdk/communication/azure-communication-chat/tests/test_chat_thread_client_e2e_async.py +++ b/sdk/communication/azure-communication-chat/tests/test_chat_thread_client_e2e_async.py @@ -48,12 +48,12 @@ def setUp(self): # create user 1 self.user = self.identity_client.create_user() - token_response = self.identity_client.issue_token(self.user, scopes=["chat"]) + token_response = self.identity_client.get_token(self.user, scopes=["chat"]) self.token = token_response.token # create user 2 self.new_user = self.identity_client.create_user() - token_response = self.identity_client.issue_token(self.new_user, scopes=["chat"]) + token_response = self.identity_client.get_token(self.new_user, scopes=["chat"]) self.token_new_user = token_response.token # create ChatClient