Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
v-xuto committed Jan 10, 2022
1 parent 31877a3 commit 513f00d
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ def test_polling_interval(self, formrecognizer_test_endpoint, formrecognizer_tes
def test_active_directory_auth(self):
token = self.generate_oauth_token()
endpoint = self.get_oauth_endpoint()
form_recognizer_endpoint_suffix = os.environ.get("FORMRECOGNIZER_ENDPOINT_SUFFIX",".cognitiveservices.azure.com/")
credential_scopes = ["https://{}.default".format(form_recognizer_endpoint_suffix[1:])]
form_recognizer_endpoint_suffix = os.environ.get("FORMRECOGNIZER_ENDPOINT_SUFFIX",".cognitiveservices.azure.com")
credential_scopes = ["https://{}/.default".format(form_recognizer_endpoint_suffix[1:])]
client = DocumentAnalysisClient(endpoint, token, credential_scopes=credential_scopes)
poller = client.begin_analyze_document_from_url("prebuilt-receipt", self.receipt_url_jpg)
result = poller.result()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ async def test_polling_interval(self, formrecognizer_test_endpoint, formrecogniz
async def test_active_directory_auth_async(self):
token = self.generate_oauth_token()
endpoint = self.get_oauth_endpoint()
form_recognizer_endpoint_suffix = os.environ.get("FORMRECOGNIZER_ENDPOINT_SUFFIX",".cognitiveservices.azure.com/")
credential_scopes = ["https://{}.default".format(form_recognizer_endpoint_suffix[1:])]
form_recognizer_endpoint_suffix = os.environ.get("FORMRECOGNIZER_ENDPOINT_SUFFIX",".cognitiveservices.azure.com")
credential_scopes = ["https://{}/.default".format(form_recognizer_endpoint_suffix[1:])]
client = DocumentAnalysisClient(endpoint, token, credential_scopes=credential_scopes)
async with client:
poller = await client.begin_analyze_document_from_url(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class TestManagement(FormRecognizerTest):
def test_active_directory_auth(self):
token = self.generate_oauth_token()
endpoint = self.get_oauth_endpoint()
form_recognizer_endpoint_suffix = os.environ.get("FORMRECOGNIZER_ENDPOINT_SUFFIX",".cognitiveservices.azure.com/")
credential_scopes = ["https://{}.default".format(form_recognizer_endpoint_suffix[1:])]
form_recognizer_endpoint_suffix = os.environ.get("FORMRECOGNIZER_ENDPOINT_SUFFIX",".cognitiveservices.azure.com")
credential_scopes = ["https://{}/.default".format(form_recognizer_endpoint_suffix[1:])]
client = DocumentModelAdministrationClient(endpoint, token, credential_scopes=credential_scopes)
info = client.get_account_info()
assert info
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ class TestManagementAsync(AsyncFormRecognizerTest):
async def test_active_directory_auth_async(self):
token = self.generate_oauth_token()
endpoint = self.get_oauth_endpoint()
form_recognizer_endpoint_suffix = os.environ.get("FORMRECOGNIZER_ENDPOINT_SUFFIX",".cognitiveservices.azure.com/")
credential_scopes = ["https://{}.default".format(form_recognizer_endpoint_suffix[1:])]
form_recognizer_endpoint_suffix = os.environ.get("FORMRECOGNIZER_ENDPOINT_SUFFIX",".cognitiveservices.azure.com")
credential_scopes = ["https://{}/.default".format(form_recognizer_endpoint_suffix[1:])]
client = DocumentModelAdministrationClient(endpoint, token, credential_scopes=credential_scopes)
async with client:
info = await client.get_account_info()
Expand Down
2 changes: 1 addition & 1 deletion sdk/formrecognizer/test-resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
}
},
"cognitiveServicesEndpointSuffix": {
"defaultValue": ".cognitiveservices.azure.com/",
"defaultValue": ".cognitiveservices.azure.com",
"type": "String"
},
"blobStorageAccount": {
Expand Down
4 changes: 2 additions & 2 deletions sdk/textanalytics/azure-ai-textanalytics/tests/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class TestAuth(TextAnalyticsTest):
@TextAnalyticsPreparer()
def test_active_directory_auth(self, textanalytics_test_endpoint):
token = self.get_credential(TextAnalyticsClient)
text_analytics_endpoint_suffix = os.environ.get("TEXTANALYTICS_ENDPOINT_SUFFIX",".cognitiveservices.azure.com/")
credential_scopes = ["https://{}.default".format(text_analytics_endpoint_suffix[1:])]
text_analytics_endpoint_suffix = os.environ.get("TEXTANALYTICS_ENDPOINT_SUFFIX",".cognitiveservices.azure.com")
credential_scopes = ["https://{}/.default".format(text_analytics_endpoint_suffix[1:])]
text_analytics = TextAnalyticsClient(textanalytics_test_endpoint, token, credential_scopes=credential_scopes)

docs = [{"id": "1", "text": "I should take my cat to the veterinarian."},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ class TestAuth(TextAnalyticsTest):
@TextAnalyticsPreparer()
async def test_active_directory_auth(self, textanalytics_test_endpoint):
token = self.get_credential(TextAnalyticsClient, is_async=True)
text_analytics_endpoint_suffix = os.environ.get("TEXTANALYTICS_ENDPOINT_SUFFIX",".cognitiveservices.azure.com/")
credential_scopes = ["https://{}.default".format(text_analytics_endpoint_suffix[1:])]
text_analytics_endpoint_suffix = os.environ.get("TEXTANALYTICS_ENDPOINT_SUFFIX",".cognitiveservices.azure.com")
credential_scopes = ["https://{}/.default".format(text_analytics_endpoint_suffix[1:])]
text_analytics = TextAnalyticsClient(textanalytics_test_endpoint, token, credential_scopes=credential_scopes)

docs = [{"id": "1", "text": "I should take my cat to the veterinarian."},
Expand Down
2 changes: 1 addition & 1 deletion sdk/textanalytics/test-resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
}
},
"cognitiveServicesEndpointSuffix": {
"defaultValue": ".cognitiveservices.azure.com/",
"defaultValue": ".cognitiveservices.azure.com",
"type": "String"
}
},
Expand Down

0 comments on commit 513f00d

Please sign in to comment.