Skip to content

Commit 5abe46f

Browse files
authored
Migrate table tests (#36237)
1 parent c9ac11b commit 5abe46f

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

sdk/tables/azure-data-tables/tests/_shared/asynctestcase.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@
1515
EdmType,
1616
)
1717
from azure.data.tables.aio import TableServiceClient
18-
from azure.identity.aio import DefaultAzureCredential
1918

20-
from devtools_testutils import is_live
19+
from devtools_testutils import is_live, get_credential
2120

2221
from .testcase import TableTestCase
2322

@@ -40,7 +39,7 @@ async def get_token(self, *args, **kwargs):
4039
class AsyncTableTestCase(TableTestCase):
4140
def get_token_credential(self):
4241
if is_live():
43-
return DefaultAzureCredential()
42+
return get_credential(is_async=True)
4443
return self.generate_fake_token_credential()
4544

4645
def generate_fake_token_credential(self):

sdk/tables/azure-data-tables/tests/_shared/testcase.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@
3131
from azure.data.tables._constants import DEFAULT_COSMOS_ENDPOINT_SUFFIX, DEFAULT_STORAGE_ENDPOINT_SUFFIX
3232
from azure.data.tables._error import _decode_error
3333
from azure.data.tables._common_conversion import _encode_base64, _to_utc_datetime
34-
from azure.identity import DefaultAzureCredential
3534

36-
from devtools_testutils import is_live
35+
from devtools_testutils import is_live, get_credential
3736

3837
TEST_TABLE_PREFIX = "pytablesync"
3938

@@ -102,7 +101,7 @@ def generate_sas_token(self):
102101

103102
def get_token_credential(self):
104103
if is_live():
105-
return DefaultAzureCredential()
104+
return get_credential()
106105
return self.generate_fake_token_credential()
107106

108107
def generate_fake_token_credential(self):

sdk/tables/tests.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@ extends:
77
ServiceDirectory: tables
88
TestTimeoutInMinutes: 180
99
SupportedClouds: 'Public,UsGov,China'
10+
UseFederatedAuth: true
1011
CloudConfig:
1112
Public:
1213
SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources)
14+
ServiceConnection: azure-sdk-tests
15+
SubscriptionConfigurationFilePaths:
16+
- eng/common/TestResources/sub-config/AzurePublicMsft.json
1317
UsGov:
1418
SubscriptionConfiguration: $(sub-config-gov-test-resources)
1519
China:
@@ -24,9 +28,6 @@ extends:
2428
BLOB_STORAGE_ACCOUNT_KEY: $(python-storage-blob-storage-account-key)
2529
OAUTH_STORAGE_ACCOUNT_NAME: $(python-storage-oauth-storage-account-name)
2630
OAUTH_STORAGE_ACCOUNT_KEY: $(python-storage-oauth-storage-account-key)
27-
AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id)
28-
AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret)
29-
AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id)
3031
BLOB_CONNECTION_STRING: $(python-storage-blob-connection-string)
3132
TEST_MODE: 'RunLiveNoRecord'
3233
AZURE_SKIP_LIVE_RECORDING: 'True'

0 commit comments

Comments
 (0)