-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use test proxy in quickstart templates (#28753)
* Use test proxy tooling * update * annotation * Use string sanitizer load_dotenv() is already called elsewhere in test tooling, so this also removes the duplicate call to preserve expected behavior --------- Co-authored-by: Yuchao Yan <[email protected]>
- Loading branch information
Showing
6 changed files
with
39 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# coding: utf-8 | ||
# ------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for | ||
# license information. | ||
# ------------------------------------------------------------------------- | ||
import os | ||
import pytest | ||
|
||
from devtools_testutils import test_proxy, add_general_string_sanitizer | ||
|
||
# For more info about add_sanitizers, please refer to https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/test_proxy_migration_guide.md#register-sanitizers | ||
@pytest.fixture(scope="session", autouse=True) | ||
def add_sanitizers(test_proxy): | ||
subscription_id = os.environ.get("{{ test_prefix | upper }}_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") | ||
tenant_id = os.environ.get("{{ test_prefix | upper }}_TENANT_ID", "00000000-0000-0000-0000-000000000000") | ||
client_id = os.environ.get("{{ test_prefix | upper }}_CLIENT_ID", "00000000-0000-0000-0000-000000000000") | ||
client_secret = os.environ.get("{{ test_prefix | upper }}_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000") | ||
add_general_string_sanitizer(target=subscription_id, value="00000000-0000-0000-0000-000000000000") | ||
add_general_string_sanitizer(target=tenant_id, value="00000000-0000-0000-0000-000000000000") | ||
add_general_string_sanitizer(target=client_id, value="00000000-0000-0000-0000-000000000000") | ||
add_general_string_sanitizer(target=client_secret, value="00000000-0000-0000-0000-000000000000") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters