From 3f52cf8507bd2ec6be8f49e80b188d85730a78dc Mon Sep 17 00:00:00 2001 From: Jiefeng Chen <51037443+BigCat20196@users.noreply.github.com> Date: Fri, 5 Aug 2022 16:13:59 +0800 Subject: [PATCH] migrate (#25551) --- .../azure-purview-scanning/tests/_util.py | 19 -- .../azure-purview-scanning/tests/conftest.py | 54 ++++ ...iewScanningSmoketest_basic_smoke_test.json | 266 ++++++++++++++++++ .../test_smoke.test_basic_smoke_test.yaml | 40 --- ...anningSmokeAsynctest_basic_smoke_test.json | 87 ++++++ ...est_smoke_async.test_basic_smoke_test.yaml | 31 -- .../tests/test_smoke.py | 6 +- .../tests/test_smoke_async.py | 6 +- .../azure-purview-scanning/tests/testcase.py | 4 +- .../tests/testcase_async.py | 4 +- sdk/purview/ci.yml | 1 + 11 files changed, 418 insertions(+), 100 deletions(-) delete mode 100644 sdk/purview/azure-purview-scanning/tests/_util.py create mode 100644 sdk/purview/azure-purview-scanning/tests/recordings/test_smoke.pyTestPurviewScanningSmoketest_basic_smoke_test.json delete mode 100644 sdk/purview/azure-purview-scanning/tests/recordings/test_smoke.test_basic_smoke_test.yaml create mode 100644 sdk/purview/azure-purview-scanning/tests/recordings/test_smoke_async.pyTestPurviewScanningSmokeAsynctest_basic_smoke_test.json delete mode 100644 sdk/purview/azure-purview-scanning/tests/recordings/test_smoke_async.test_basic_smoke_test.yaml diff --git a/sdk/purview/azure-purview-scanning/tests/_util.py b/sdk/purview/azure-purview-scanning/tests/_util.py deleted file mode 100644 index 50ee62f8e5d7..000000000000 --- a/sdk/purview/azure-purview-scanning/tests/_util.py +++ /dev/null @@ -1,19 +0,0 @@ -# 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. -# -------------------------------------------------------------------------- -from azure_devtools.scenario_tests import RecordingProcessor -import json - - -class PurviewScanningRecordingProcessor(RecordingProcessor): - def process_response(self, response): - try: - body = json.loads(response["body"]["string"]) - for value in body["value"]: - value["properties"]["subscriptionId"] = "000" - response["body"]["string"] = json.dumps(body) - finally: - return response diff --git a/sdk/purview/azure-purview-scanning/tests/conftest.py b/sdk/purview/azure-purview-scanning/tests/conftest.py index e69de29bb2d1..a2b67062c421 100644 --- a/sdk/purview/azure-purview-scanning/tests/conftest.py +++ b/sdk/purview/azure-purview-scanning/tests/conftest.py @@ -0,0 +1,54 @@ +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- +import os +import platform +import pytest +import sys + +from dotenv import load_dotenv + +from devtools_testutils import test_proxy, add_general_regex_sanitizer, add_body_key_sanitizer, add_header_regex_sanitizer + +# Ignore async tests for Python < 3.5 +collect_ignore_glob = [] +if sys.version_info < (3, 5) or platform.python_implementation() == "PyPy": + collect_ignore_glob.append("*_async.py") + +load_dotenv() + +@pytest.fixture(scope="session", autouse=True) +def add_sanitizers(test_proxy): + subscription_id = os.environ.get("PURVIEWCATALOG_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") + tenant_id = os.environ.get("PURVIEWCATALOG_TENANT_ID", "00000000-0000-0000-0000-000000000000") + client_id = os.environ.get("PURVIEWCATALOG_CLIENT_ID", "00000000-0000-0000-0000-000000000000") + client_secret = os.environ.get("PURVIEWCATALOG_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=subscription_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=tenant_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=client_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=client_secret, value="00000000-0000-0000-0000-000000000000") + add_header_regex_sanitizer(key="Set-Cookie", value="[set-cookie;]") + add_header_regex_sanitizer(key="Cookie", value="cookie;") + add_body_key_sanitizer(json_path="$..access_token", value="access_token") diff --git a/sdk/purview/azure-purview-scanning/tests/recordings/test_smoke.pyTestPurviewScanningSmoketest_basic_smoke_test.json b/sdk/purview/azure-purview-scanning/tests/recordings/test_smoke.pyTestPurviewScanningSmoketest_basic_smoke_test.json new file mode 100644 index 000000000000..0e0bd359d9b6 --- /dev/null +++ b/sdk/purview/azure-purview-scanning/tests/recordings/test_smoke.pyTestPurviewScanningSmoketest_basic_smoke_test.json @@ -0,0 +1,266 @@ +{ + "Entries": [ + { + "RequestUri": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/v2.0/.well-known/openid-configuration", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azsdk-python-identity/1.11.0b3 Python/3.8.8 (Windows-10-10.0.19041-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Allow-Methods": "GET, OPTIONS", + "Access-Control-Allow-Origin": "*", + "Cache-Control": "max-age=86400, private", + "Content-Length": "1753", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 04 Aug 2022 06:06:14 GMT", + "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", + "Set-Cookie": "[set-cookie;]", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-ests-server": "2.1.13418.9 - WUS2 ProdSlices", + "X-XSS-Protection": "0" + }, + "ResponseBody": { + "token_endpoint": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/oauth2/v2.0/token", + "token_endpoint_auth_methods_supported": [ + "client_secret_post", + "private_key_jwt", + "client_secret_basic" + ], + "jwks_uri": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/discovery/v2.0/keys", + "response_modes_supported": [ + "query", + "fragment", + "form_post" + ], + "subject_types_supported": [ + "pairwise" + ], + "id_token_signing_alg_values_supported": [ + "RS256" + ], + "response_types_supported": [ + "code", + "id_token", + "code id_token", + "id_token token" + ], + "scopes_supported": [ + "openid", + "profile", + "email", + "offline_access" + ], + "issuer": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/v2.0", + "request_uri_parameter_supported": false, + "userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo", + "authorization_endpoint": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/oauth2/v2.0/authorize", + "device_authorization_endpoint": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/oauth2/v2.0/devicecode", + "http_logout_supported": true, + "frontchannel_logout_supported": true, + "end_session_endpoint": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/oauth2/v2.0/logout", + "claims_supported": [ + "sub", + "iss", + "cloud_instance_name", + "cloud_instance_host_name", + "cloud_graph_host_name", + "msgraph_host", + "aud", + "exp", + "iat", + "auth_time", + "acr", + "nonce", + "preferred_username", + "name", + "tid", + "ver", + "at_hash", + "c_hash", + "email" + ], + "kerberos_endpoint": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/kerberos", + "tenant_region_scope": "NA", + "cloud_instance_name": "microsoftonline.com", + "cloud_graph_host_name": "graph.windows.net", + "msgraph_host": "graph.microsoft.com", + "rbac_url": "https://pas.windows.net" + } + }, + { + "RequestUri": "https://login.microsoftonline.com/common/discovery/instance?api-version=1.1\u0026authorization_endpoint=https://login.microsoftonline.com/common/oauth2/authorize", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "Cookie": "cookie;", + "User-Agent": "azsdk-python-identity/1.11.0b3 Python/3.8.8 (Windows-10-10.0.19041-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Allow-Methods": "GET, OPTIONS", + "Access-Control-Allow-Origin": "*", + "Cache-Control": "max-age=86400, private", + "Content-Length": "945", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 04 Aug 2022 06:06:15 GMT", + "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", + "Set-Cookie": "[set-cookie;]", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-ests-server": "2.1.13418.10 - KRC ProdSlices", + "X-XSS-Protection": "0" + }, + "ResponseBody": { + "tenant_discovery_endpoint": "https://login.microsoftonline.com/common/.well-known/openid-configuration", + "api-version": "1.1", + "metadata": [ + { + "preferred_network": "login.microsoftonline.com", + "preferred_cache": "login.windows.net", + "aliases": [ + "login.microsoftonline.com", + "login.windows.net", + "login.microsoft.com", + "sts.windows.net" + ] + }, + { + "preferred_network": "login.partner.microsoftonline.cn", + "preferred_cache": "login.partner.microsoftonline.cn", + "aliases": [ + "login.partner.microsoftonline.cn", + "login.chinacloudapi.cn" + ] + }, + { + "preferred_network": "login.microsoftonline.de", + "preferred_cache": "login.microsoftonline.de", + "aliases": [ + "login.microsoftonline.de" + ] + }, + { + "preferred_network": "login.microsoftonline.us", + "preferred_cache": "login.microsoftonline.us", + "aliases": [ + "login.microsoftonline.us", + "login.usgovcloudapi.net" + ] + }, + { + "preferred_network": "login-us.microsoftonline.com", + "preferred_cache": "login-us.microsoftonline.com", + "aliases": [ + "login-us.microsoftonline.com" + ] + } + ] + } + }, + { + "RequestUri": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/oauth2/v2.0/token", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "client-request-id": "f5e65aad-c251-4ca0-937f-f77250f91250", + "Connection": "keep-alive", + "Content-Length": "285", + "Content-Type": "application/x-www-form-urlencoded", + "Cookie": "cookie;", + "User-Agent": "azsdk-python-identity/1.11.0b3 Python/3.8.8 (Windows-10-10.0.19041-SP0)", + "x-client-cpu": "x64", + "x-client-current-telemetry": "4|730,0|", + "x-client-last-telemetry": "4|0|||", + "x-client-os": "win32", + "x-client-sku": "MSAL.Python", + "x-client-ver": "1.16.0", + "x-ms-lib-capability": "retry-after, h429" + }, + "RequestBody": "client_id=00000000-0000-0000-0000-000000000000\u0026grant_type=client_credentials\u0026client_info=1\u0026client_secret=00000000-0000-0000-0000-000000000000\u0026claims=%7B%22access_token%22%3A\u002B%7B%22xms_cc%22%3A\u002B%7B%22values%22%3A\u002B%5B%22CP1%22%5D%7D%7D%7D\u0026scope=https%3A%2F%2Fpurview.azure.net%2F.default", + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-store, no-cache", + "client-request-id": "f5e65aad-c251-4ca0-937f-f77250f91250", + "Content-Length": "93", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 04 Aug 2022 06:06:15 GMT", + "Expires": "-1", + "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", + "Pragma": "no-cache", + "Set-Cookie": "[set-cookie;]", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-clitelem": "1,0,0,,", + "x-ms-ests-server": "2.1.13418.9 - EUS ProdSlices", + "X-XSS-Protection": "0" + }, + "ResponseBody": { + "token_type": "Bearer", + "expires_in": 3599, + "ext_expires_in": 3599, + "access_token": "access_token" + } + }, + { + "RequestUri": "https://fake_account.scan.purview.azure.com/datasources?api-version=2018-12-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azsdk-python-purview-scanning/1.0.0b3 Python/3.8.8 (Windows-10-10.0.19041-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2018-12-01-preview, 2021-10-01-preview, 2022-02-01-preview", + "Content-Length": "627", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 04 Aug 2022 06:06:17 GMT", + "Request-Context": "appId=cid-v1:caaf2286-a721-4ba8-a2bd-9a1b7993b4fd", + "Server": "Kestrel", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "x-ms-correlation-request-id": "d69801e1-916d-4537-a218-5493580c87af" + }, + "ResponseBody": { + "value": [ + { + "properties": { + "endpoint": "https://storageyyc.blob.core.windows.net/", + "resourceGroup": "python-sdk-test", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "location": "westus", + "resourceName": "storageyyc", + "resourceId": null, + "dataUseGovernance": "Disabled", + "createdAt": "2021-09-29T03:35:39.2638722Z", + "lastModifiedAt": "2021-09-29T03:35:39.2638722Z", + "parentCollection": null, + "collection": { + "lastModifiedAt": "2021-09-29T03:35:39.2638722Z", + "referenceName": "purview-msyyc", + "type": "CollectionReference" + }, + "dataSourceCollectionMovingState": 0 + }, + "kind": "AzureStorage", + "id": "datasources/storageyyc", + "name": "storageyyc" + } + ], + "count": 1 + } + } + ], + "Variables": {} +} diff --git a/sdk/purview/azure-purview-scanning/tests/recordings/test_smoke.test_basic_smoke_test.yaml b/sdk/purview/azure-purview-scanning/tests/recordings/test_smoke.test_basic_smoke_test.yaml deleted file mode 100644 index b156f46f45a3..000000000000 --- a/sdk/purview/azure-purview-scanning/tests/recordings/test_smoke.test_basic_smoke_test.yaml +++ /dev/null @@ -1,40 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-purview-scanning/1.0.0b2 Python/3.7.3 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://fake_account.scan.purview.azure.com/datasources?api-version=2018-12-01-preview - response: - body: - string: '{"value": [{"properties": {"endpoint": "https://storageyyc.blob.core.windows.net/", - "resourceGroup": "python-sdk-test", "subscriptionId": "000", "location": "westus", - "resourceName": "storageyyc", "createdAt": "2021-09-29T03:35:39.2638722Z", - "lastModifiedAt": "2021-09-29T03:35:39.2638722Z", "parentCollection": null, - "collection": {"lastModifiedAt": "2021-09-29T03:35:39.2638722Z", "referenceName": - "purview-msyyc", "type": "CollectionReference"}}, "kind": "AzureStorage", - "id": "datasources/storageyyc", "name": "storageyyc"}], "count": 1}' - headers: - content-length: - - '542' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 29 Sep 2021 04:49:26 GMT - request-context: - - appId=cid-v1:caaf2286-a721-4ba8-a2bd-9a1b7993b4fd - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/purview/azure-purview-scanning/tests/recordings/test_smoke_async.pyTestPurviewScanningSmokeAsynctest_basic_smoke_test.json b/sdk/purview/azure-purview-scanning/tests/recordings/test_smoke_async.pyTestPurviewScanningSmokeAsynctest_basic_smoke_test.json new file mode 100644 index 000000000000..6f30837dd06d --- /dev/null +++ b/sdk/purview/azure-purview-scanning/tests/recordings/test_smoke_async.pyTestPurviewScanningSmokeAsynctest_basic_smoke_test.json @@ -0,0 +1,87 @@ +{ + "Entries": [ + { + "RequestUri": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/oauth2/v2.0/token", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Content-Length": "176", + "Content-Type": "application/x-www-form-urlencoded", + "User-Agent": "azsdk-python-identity/1.11.0b3 Python/3.8.8 (Windows-10-10.0.19041-SP0)" + }, + "RequestBody": "client_id=00000000-0000-0000-0000-000000000000\u0026client_secret=00000000-0000-0000-0000-000000000000\u0026grant_type=client_credentials\u0026scope=https%3A%2F%2Fpurview.azure.net%2F.default", + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-store, no-cache", + "Content-Length": "93", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 04 Aug 2022 06:06:17 GMT", + "Expires": "-1", + "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", + "Pragma": "no-cache", + "Set-Cookie": "[set-cookie;]", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-ests-server": "2.1.13418.9 - EUS ProdSlices", + "X-XSS-Protection": "0" + }, + "ResponseBody": { + "token_type": "Bearer", + "expires_in": 3599, + "ext_expires_in": 3599, + "access_token": "access_token" + } + }, + { + "RequestUri": "https://fake_account.scan.purview.azure.com/datasources?api-version=2018-12-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "User-Agent": "azsdk-python-purview-scanning/1.0.0b3 Python/3.8.8 (Windows-10-10.0.19041-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2018-12-01-preview, 2021-10-01-preview, 2022-02-01-preview", + "Content-Length": "627", + "Content-Type": "application/json; charset=utf-8", + "Date": "Thu, 04 Aug 2022 06:06:18 GMT", + "Request-Context": "appId=cid-v1:caaf2286-a721-4ba8-a2bd-9a1b7993b4fd", + "Server": "Kestrel", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "x-ms-correlation-request-id": "edaa078b-b2ab-4b8c-8694-1110a6e4dd32" + }, + "ResponseBody": { + "value": [ + { + "properties": { + "endpoint": "https://storageyyc.blob.core.windows.net/", + "resourceGroup": "python-sdk-test", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "location": "westus", + "resourceName": "storageyyc", + "resourceId": null, + "dataUseGovernance": "Disabled", + "createdAt": "2021-09-29T03:35:39.2638722Z", + "lastModifiedAt": "2021-09-29T03:35:39.2638722Z", + "parentCollection": null, + "collection": { + "lastModifiedAt": "2021-09-29T03:35:39.2638722Z", + "referenceName": "purview-msyyc", + "type": "CollectionReference" + }, + "dataSourceCollectionMovingState": 0 + }, + "kind": "AzureStorage", + "id": "datasources/storageyyc", + "name": "storageyyc" + } + ], + "count": 1 + } + } + ], + "Variables": {} +} diff --git a/sdk/purview/azure-purview-scanning/tests/recordings/test_smoke_async.test_basic_smoke_test.yaml b/sdk/purview/azure-purview-scanning/tests/recordings/test_smoke_async.test_basic_smoke_test.yaml deleted file mode 100644 index b98e6e82b192..000000000000 --- a/sdk/purview/azure-purview-scanning/tests/recordings/test_smoke_async.test_basic_smoke_test.yaml +++ /dev/null @@ -1,31 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - application/json - User-Agent: - - azsdk-python-purview-scanning/1.0.0b2 Python/3.7.3 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://fake_account.scan.purview.azure.com/datasources?api-version=2018-12-01-preview - response: - body: - string: '{"value": [{"properties": {"endpoint": "https://storageyyc.blob.core.windows.net/", - "resourceGroup": "python-sdk-test", "subscriptionId": "000", "location": "westus", - "resourceName": "storageyyc", "createdAt": "2021-09-29T03:35:39.2638722Z", - "lastModifiedAt": "2021-09-29T03:35:39.2638722Z", "parentCollection": null, - "collection": {"lastModifiedAt": "2021-09-29T03:35:39.2638722Z", "referenceName": - "purview-msyyc", "type": "CollectionReference"}}, "kind": "AzureStorage", - "id": "datasources/storageyyc", "name": "storageyyc"}], "count": 1}' - headers: - content-length: '542' - content-type: application/json; charset=utf-8 - date: Wed, 29 Sep 2021 04:50:29 GMT - request-context: appId=cid-v1:caaf2286-a721-4ba8-a2bd-9a1b7993b4fd - server: Kestrel - strict-transport-security: max-age=31536000; includeSubDomains - status: - code: 200 - message: OK - url: https://purview-msyyc.scan.purview.azure.com/datasources?api-version=2018-12-01-preview -version: 1 diff --git a/sdk/purview/azure-purview-scanning/tests/test_smoke.py b/sdk/purview/azure-purview-scanning/tests/test_smoke.py index ed98c3344d81..cccf9d71ecc1 100644 --- a/sdk/purview/azure-purview-scanning/tests/test_smoke.py +++ b/sdk/purview/azure-purview-scanning/tests/test_smoke.py @@ -5,13 +5,13 @@ # license information. # ------------------------------------------------------------------------- from testcase import PurviewScanningTest, PurviewScanningPowerShellPreparer -from _util import PurviewScanningRecordingProcessor +from devtools_testutils import recorded_by_proxy -class PurviewScanningSmokeTest(PurviewScanningTest): +class TestPurviewScanningSmoke(PurviewScanningTest): @PurviewScanningPowerShellPreparer() + @recorded_by_proxy def test_basic_smoke_test(self, purviewscanning_endpoint): - self.recording_processors.append(PurviewScanningRecordingProcessor()) client = self.create_client(endpoint=purviewscanning_endpoint) response = client.data_sources.list_all() result = [item for item in response] diff --git a/sdk/purview/azure-purview-scanning/tests/test_smoke_async.py b/sdk/purview/azure-purview-scanning/tests/test_smoke_async.py index 3798d26df16f..b534d9f652f6 100644 --- a/sdk/purview/azure-purview-scanning/tests/test_smoke_async.py +++ b/sdk/purview/azure-purview-scanning/tests/test_smoke_async.py @@ -6,13 +6,13 @@ # ------------------------------------------------------------------------- from testcase import PurviewScanningPowerShellPreparer from testcase_async import PurviewScanningTestAsync -from _util import PurviewScanningRecordingProcessor +from devtools_testutils.aio import recorded_by_proxy_async -class PurviewScanningSmokeTestAsync(PurviewScanningTestAsync): +class TestPurviewScanningSmokeAsync(PurviewScanningTestAsync): @PurviewScanningPowerShellPreparer() + @recorded_by_proxy_async async def test_basic_smoke_test(self, purviewscanning_endpoint): - self.recording_processors.append(PurviewScanningRecordingProcessor()) client = self.create_async_client(endpoint=purviewscanning_endpoint) response = client.data_sources.list_all() result = [item async for item in response] diff --git a/sdk/purview/azure-purview-scanning/tests/testcase.py b/sdk/purview/azure-purview-scanning/tests/testcase.py index 96452942dc3a..2e11e1c682de 100644 --- a/sdk/purview/azure-purview-scanning/tests/testcase.py +++ b/sdk/purview/azure-purview-scanning/tests/testcase.py @@ -5,11 +5,11 @@ # license information. # -------------------------------------------------------------------------- import functools -from devtools_testutils import AzureTestCase, PowerShellPreparer +from devtools_testutils import AzureRecordedTestCase, PowerShellPreparer from azure.purview.scanning import PurviewScanningClient -class PurviewScanningTest(AzureTestCase): +class PurviewScanningTest(AzureRecordedTestCase): def create_client(self, endpoint): credential = self.get_credential(PurviewScanningClient) diff --git a/sdk/purview/azure-purview-scanning/tests/testcase_async.py b/sdk/purview/azure-purview-scanning/tests/testcase_async.py index 4580662b4178..c3c36e71843f 100644 --- a/sdk/purview/azure-purview-scanning/tests/testcase_async.py +++ b/sdk/purview/azure-purview-scanning/tests/testcase_async.py @@ -4,11 +4,11 @@ # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- -from devtools_testutils import AzureTestCase +from devtools_testutils import AzureRecordedTestCase from azure.purview.scanning.aio import PurviewScanningClient as AsyncPurviewScanningClient -class PurviewScanningTestAsync(AzureTestCase): +class PurviewScanningTestAsync(AzureRecordedTestCase): def create_async_client(self, endpoint): credential = self.get_credential(AsyncPurviewScanningClient, is_async=True) diff --git a/sdk/purview/ci.yml b/sdk/purview/ci.yml index c647395dd3be..5e90b3114c84 100644 --- a/sdk/purview/ci.yml +++ b/sdk/purview/ci.yml @@ -28,6 +28,7 @@ extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: ServiceDirectory: purview + TestProxy: true Artifacts: - name: azure-mgmt-purview safeName: azuremgmtpurview