From 5ec090cb4afe78103bd9fea731cd3430f47d1e30 Mon Sep 17 00:00:00 2001 From: Krista Pratico Date: Fri, 14 Aug 2020 15:36:16 -0700 Subject: [PATCH] fix aad test so it runs locally --- .../azure-ai-formrecognizer/tests/test_samples.py | 4 ++++ .../azure-ai-formrecognizer/tests/test_samples_async.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_samples.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_samples.py index b5e0122cd43e..417b28d88d94 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_samples.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_samples.py @@ -57,6 +57,10 @@ class TestSamples(FormRecognizerTest): @pytest.mark.live_test_only @GlobalFormRecognizerAccountPreparer() def test_sample_authentication(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): + os.environ['AZURE_FORM_RECOGNIZER_AAD_ENDPOINT'] = self.get_settings_value("FORM_RECOGNIZER_AAD_ENDPOINT") + os.environ['AZURE_CLIENT_ID'] = self.get_settings_value("CLIENT_ID") + os.environ['AZURE_CLIENT_SECRET'] = self.get_settings_value("CLIENT_SECRET") + os.environ['AZURE_TENANT_ID'] = self.get_settings_value("TENANT_ID") _test_file('sample_authentication.py', form_recognizer_account, form_recognizer_account_key) @pytest.mark.live_test_only diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_samples_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_samples_async.py index d23a8eed33b5..0a9f6f229c7b 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_samples_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_samples_async.py @@ -54,6 +54,10 @@ class TestSamplesAsync(FormRecognizerTest): @pytest.mark.live_test_only @GlobalFormRecognizerAccountPreparer() def test_sample_authentication_async(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): + os.environ['AZURE_FORM_RECOGNIZER_AAD_ENDPOINT'] = self.get_settings_value("FORM_RECOGNIZER_AAD_ENDPOINT") + os.environ['AZURE_CLIENT_ID'] = self.get_settings_value("CLIENT_ID") + os.environ['AZURE_CLIENT_SECRET'] = self.get_settings_value("CLIENT_SECRET") + os.environ['AZURE_TENANT_ID'] = self.get_settings_value("TENANT_ID") _test_file('sample_authentication_async.py', form_recognizer_account, form_recognizer_account_key) @pytest.mark.live_test_only