diff --git a/doc/authoring_tests.md b/doc/authoring_tests.md index f1b8e6e23d4..ac015297f7c 100644 --- a/doc/authoring_tests.md +++ b/doc/authoring_tests.md @@ -269,7 +269,7 @@ class StorageAccountTests(ScenarioTest): Note: 1. Like `ResourceGroupPreparer`, you can use `StorageAccountPreparer` to prepare a disposable storage account for the test. The account is deleted along with the resource group during test teardown. -2. Creation of a storage account requires a resource group. Therefore `ResourceGroupPrepare` must be placed above `StorageAccountPreparer`, since preparers are designed to be executed from top to bottom. (The core preparer implementation is in the [AbstractPreparer](https://github.com/Azure/azure-python-devtools/blob/master/src/azure_devtools/scenario_tests/preparers.py) class in the [azure-devtools](https://pypi.python.org/pypi/azure-devtools) package.) +2. Creation of a storage account requires a resource group. Therefore `ResourceGroupPrepare` must be placed above `StorageAccountPreparer`, since preparers are designed to be executed from top to bottom. (The core preparer implementation is in the `azure.cli.testsdk.scenario_tests.preparers.AbstractPreparer`.) 3. The preparers communicate among themselves by adding values to the `kwargs` of the decorated methods. Therefore the `StorageAccountPreparer` uses the resource group created in the preceding `ResourceGroupPreparer`. 4. The `StorageAccountPreparer` can be further customized to modify the parameters of the created storage account: diff --git a/src/azure-cli-core/azure/cli/core/commands/tests/test_client_factory.py b/src/azure-cli-core/azure/cli/core/commands/tests/test_client_factory.py index 637b1a1d0d4..3265657e61a 100644 --- a/src/azure-cli-core/azure/cli/core/commands/tests/test_client_factory.py +++ b/src/azure-cli-core/azure/cli/core/commands/tests/test_client_factory.py @@ -16,7 +16,7 @@ from azure.cli.testsdk import live_only, MOCKED_USER_NAME from azure.cli.testsdk.constants import AUX_SUBSCRIPTION, AUX_TENANT -from azure_devtools.scenario_tests.const import MOCKED_SUBSCRIPTION_ID, MOCKED_TENANT_ID +from azure.cli.testsdk.scenario_tests.const import MOCKED_SUBSCRIPTION_ID, MOCKED_TENANT_ID mock_subscriptions = [ { diff --git a/src/azure-cli-testsdk/azure/cli/testsdk/__init__.py b/src/azure-cli-testsdk/azure/cli/testsdk/__init__.py index 59fd405bd27..51d9a00ce80 100644 --- a/src/azure-cli-testsdk/azure/cli/testsdk/__init__.py +++ b/src/azure-cli-testsdk/azure/cli/testsdk/__init__.py @@ -3,7 +3,7 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -from azure_devtools.scenario_tests import live_only, record_only, get_sha1_hash +from .scenario_tests import live_only, record_only, get_sha1_hash from .base import ScenarioTest, LiveScenarioTest, LocalContextScenarioTest from .preparers import (StorageAccountPreparer, ResourceGroupPreparer, RoleBasedServicePrincipalPreparer, diff --git a/src/azure-cli-testsdk/azure/cli/testsdk/base.py b/src/azure-cli-testsdk/azure/cli/testsdk/base.py index 8c21f56c386..9585ac40cc0 100644 --- a/src/azure-cli-testsdk/azure/cli/testsdk/base.py +++ b/src/azure-cli-testsdk/azure/cli/testsdk/base.py @@ -11,12 +11,12 @@ import unittest import tempfile -from azure_devtools.scenario_tests import (IntegrationTestBase, ReplayableTest, SubscriptionRecordingProcessor, - LargeRequestBodyProcessor, - LargeResponseBodyProcessor, LargeResponseBodyReplacer, RequestUrlNormalizer, - live_only, DeploymentNameReplacer, patch_time_sleep_api, create_random_name) +from .scenario_tests import (IntegrationTestBase, ReplayableTest, SubscriptionRecordingProcessor, + LargeRequestBodyProcessor, + LargeResponseBodyProcessor, LargeResponseBodyReplacer, RequestUrlNormalizer, + live_only, DeploymentNameReplacer, patch_time_sleep_api, create_random_name) -from azure_devtools.scenario_tests.const import MOCKED_SUBSCRIPTION_ID, ENV_SKIP_ASSERT +from .scenario_tests.const import MOCKED_SUBSCRIPTION_ID, ENV_SKIP_ASSERT from .patches import (patch_load_cached_subscriptions, patch_main_exception_handler, patch_retrieve_token_for_user, patch_long_run_operation_delay, diff --git a/src/azure-cli-testsdk/azure/cli/testsdk/patches.py b/src/azure-cli-testsdk/azure/cli/testsdk/patches.py index 76abe36a4b1..208d5e980b9 100644 --- a/src/azure-cli-testsdk/azure/cli/testsdk/patches.py +++ b/src/azure-cli-testsdk/azure/cli/testsdk/patches.py @@ -3,8 +3,8 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -from azure_devtools.scenario_tests import mock_in_unit_test -from azure_devtools.scenario_tests.const import MOCKED_SUBSCRIPTION_ID, MOCKED_TENANT_ID +from .scenario_tests import mock_in_unit_test +from .scenario_tests.const import MOCKED_SUBSCRIPTION_ID, MOCKED_TENANT_ID from .exceptions import CliExecutionError diff --git a/src/azure-cli-testsdk/azure/cli/testsdk/preparers.py b/src/azure-cli-testsdk/azure/cli/testsdk/preparers.py index 19026a393ff..ae638014bb7 100644 --- a/src/azure-cli-testsdk/azure/cli/testsdk/preparers.py +++ b/src/azure-cli-testsdk/azure/cli/testsdk/preparers.py @@ -6,7 +6,7 @@ import os from datetime import datetime -from azure_devtools.scenario_tests import AbstractPreparer, SingleValueReplacer +from .scenario_tests import AbstractPreparer, SingleValueReplacer from .base import LiveScenarioTest from .exceptions import CliTestError diff --git a/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/__init__.py b/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/__init__.py new file mode 100644 index 00000000000..d8b1ab8b983 --- /dev/null +++ b/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/__init__.py @@ -0,0 +1,35 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +""" +This module is vendored from +https://github.com/Azure/azure-python-devtools/tree/1.2.0/src/azure_devtools/scenario_tests + +More info: https://github.com/Azure/azure-cli/pull/20601 +""" + +from .base import IntegrationTestBase, ReplayableTest, LiveTest +from .exceptions import AzureTestError +from .decorators import live_only, record_only, AllowLargeResponse +from .patches import mock_in_unit_test, patch_time_sleep_api, patch_long_run_operation_delay +from .preparers import AbstractPreparer, SingleValueReplacer +from .recording_processors import ( + RecordingProcessor, SubscriptionRecordingProcessor, + LargeRequestBodyProcessor, LargeResponseBodyProcessor, LargeResponseBodyReplacer, + OAuthRequestResponsesFilter, DeploymentNameReplacer, GeneralNameReplacer, AccessTokenReplacer, RequestUrlNormalizer, +) +from .utilities import create_random_name, get_sha1_hash + +__all__ = ['IntegrationTestBase', 'ReplayableTest', 'LiveTest', + 'AzureTestError', + 'mock_in_unit_test', 'patch_time_sleep_api', 'patch_long_run_operation_delay', + 'AbstractPreparer', 'SingleValueReplacer', 'AllowLargeResponse', + 'RecordingProcessor', 'SubscriptionRecordingProcessor', + 'LargeRequestBodyProcessor', 'LargeResponseBodyProcessor', 'LargeResponseBodyReplacer', + 'OAuthRequestResponsesFilter', 'DeploymentNameReplacer', 'GeneralNameReplacer', + 'AccessTokenReplacer', 'RequestUrlNormalizer', + 'live_only', 'record_only', + 'create_random_name', 'get_sha1_hash'] +__version__ = '0.5.2' diff --git a/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/base.py b/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/base.py new file mode 100644 index 00000000000..3c4ee9e1d8f --- /dev/null +++ b/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/base.py @@ -0,0 +1,219 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from __future__ import print_function +import unittest +import os +import inspect +import tempfile +import shutil +import logging +import threading +import six +import vcr + +from .config import TestConfig +from .const import ENV_TEST_DIAGNOSE +from .utilities import create_random_name +from .decorators import live_only + + +class IntegrationTestBase(unittest.TestCase): + def __init__(self, method_name): + super(IntegrationTestBase, self).__init__(method_name) + self.diagnose = os.environ.get(ENV_TEST_DIAGNOSE, None) == 'True' + self.logger = logging.getLogger('azure.cli.testsdk.scenario_tests') + + def create_random_name(self, prefix, length): # pylint: disable=no-self-use + return create_random_name(prefix=prefix, length=length) + + def create_temp_file(self, size_kb, full_random=False): + """ + Create a temporary file for testing. The test harness will delete the file during tearing down. + :param float size_kb: specify the generated file size in kb. + """ + fd, path = tempfile.mkstemp() + os.close(fd) + self.addCleanup(lambda: os.remove(path)) + + with open(path, mode='r+b') as f: + if full_random: + chunk = os.urandom(1024) + else: + chunk = bytearray([0] * 1024) + for _ in range(int(size_kb)): + f.write(chunk) + chunk = os.urandom(int(1024 * (size_kb % 1))) + f.write(chunk) + + return path + + def create_temp_dir(self): + """ + Create a temporary directory for testing. The test harness will delete the directory during tearing down. + """ + temp_dir = tempfile.mkdtemp() + self.addCleanup(lambda: shutil.rmtree(temp_dir, ignore_errors=True)) + + return temp_dir + + @classmethod + def set_env(cls, key, val): + os.environ[key] = val + + @classmethod + def pop_env(cls, key): + return os.environ.pop(key, None) + + +@live_only() +class LiveTest(IntegrationTestBase): + pass + + +class ReplayableTest(IntegrationTestBase): # pylint: disable=too-many-instance-attributes + FILTER_HEADERS = [ + 'authorization', + 'client-request-id', + 'retry-after', + 'x-ms-client-request-id', + 'x-ms-correlation-request-id', + 'x-ms-ratelimit-remaining-subscription-reads', + 'x-ms-request-id', + 'x-ms-routing-request-id', + 'x-ms-gateway-service-instanceid', + 'x-ms-ratelimit-remaining-tenant-reads', + 'x-ms-served-by', + 'x-ms-authorization-auxiliary' + ] + + def __init__(self, # pylint: disable=too-many-arguments + method_name, config_file=None, recording_dir=None, recording_name=None, recording_processors=None, + replay_processors=None, recording_patches=None, replay_patches=None): + super(ReplayableTest, self).__init__(method_name) + + self.recording_processors = recording_processors or [] + self.replay_processors = replay_processors or [] + + self.recording_patches = recording_patches or [] + self.replay_patches = replay_patches or [] + + self.config = TestConfig(config_file=config_file) + + self.disable_recording = False + + test_file_path = inspect.getfile(self.__class__) + recording_dir = recording_dir or os.path.join(os.path.dirname(test_file_path), 'recordings') + self.is_live = self.config.record_mode + + self.vcr = vcr.VCR( + cassette_library_dir=recording_dir, + before_record_request=self._process_request_recording, + before_record_response=self._process_response_recording, + decode_compressed_response=True, + record_mode='once' if not self.is_live else 'all', + filter_headers=self.FILTER_HEADERS + ) + self.vcr.register_matcher('query', self._custom_request_query_matcher) + + self.recording_file = os.path.join( + recording_dir, + '{}.yaml'.format(recording_name or method_name) + ) + if self.is_live and os.path.exists(self.recording_file): + os.remove(self.recording_file) + + self.in_recording = self.is_live or not os.path.exists(self.recording_file) + self.test_resources_count = 0 + self.original_env = os.environ.copy() + + def setUp(self): + super(ReplayableTest, self).setUp() + + # set up cassette + cm = self.vcr.use_cassette(self.recording_file) + self.cassette = cm.__enter__() + self.addCleanup(cm.__exit__) + + # set up mock patches + if self.in_recording: + for patch in self.recording_patches: + patch(self) + else: + for patch in self.replay_patches: + patch(self) + + def tearDown(self): + os.environ = self.original_env + # Autorest.Python 2.x + assert not [t for t in threading.enumerate() if t.name.startswith("AzureOperationPoller")], \ + "You need to call 'result' or 'wait' on all AzureOperationPoller you have created" + # Autorest.Python 3.x + assert not [t for t in threading.enumerate() if t.name.startswith("LROPoller")], \ + "You need to call 'result' or 'wait' on all LROPoller you have created" + + def _process_request_recording(self, request): + if self.disable_recording: + return None + + if self.in_recording: + for processor in self.recording_processors: + request = processor.process_request(request) + if not request: + break + else: + for processor in self.replay_processors: + request = processor.process_request(request) + if not request: + break + + return request + + def _process_response_recording(self, response): + from .utilities import is_text_payload + if self.in_recording: + # make header name lower case and filter unwanted headers + headers = {} + for key in response['headers']: + if key.lower() not in self.FILTER_HEADERS: + headers[key.lower()] = response['headers'][key] + response['headers'] = headers + + body = response['body']['string'] + if is_text_payload(response) and body and not isinstance(body, six.string_types): + response['body']['string'] = body.decode('utf-8') + + for processor in self.recording_processors: + response = processor.process_response(response) + if not response: + break + else: + for processor in self.replay_processors: + response = processor.process_response(response) + if not response: + break + + return response + + @classmethod + def _custom_request_query_matcher(cls, r1, r2): + """ Ensure method, path, and query parameters match. """ + from six.moves.urllib_parse import urlparse, parse_qs # pylint: disable=import-error, relative-import + + url1 = urlparse(r1.uri) + url2 = urlparse(r2.uri) + + q1 = parse_qs(url1.query) + q2 = parse_qs(url2.query) + shared_keys = set(q1.keys()).intersection(set(q2.keys())) + + if len(shared_keys) != len(q1) or len(shared_keys) != len(q2): + return False + + for key in shared_keys: + if q1[key][0].lower() != q2[key][0].lower(): + return False + + return True diff --git a/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/config.py b/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/config.py new file mode 100644 index 00000000000..ac6ac6f91c0 --- /dev/null +++ b/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/config.py @@ -0,0 +1,28 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import configargparse + +from .const import ENV_LIVE_TEST + + +class TestConfig(object): # pylint: disable=too-few-public-methods + def __init__(self, parent_parsers=None, config_file=None): + parent_parsers = parent_parsers or [] + self.parser = configargparse.ArgumentParser(parents=parent_parsers) + self.parser.add_argument( + '-c', '--config', is_config_file=True, default=config_file, + help='Path to a configuration file in YAML format.' + ) + self.parser.add_argument( + '-l', '--live-mode', action='store_true', dest='live_mode', + env_var=ENV_LIVE_TEST, + help='Activate "live" recording mode for tests.' + ) + self.args = self.parser.parse_args([]) + + @property + def record_mode(self): + return self.args.live_mode diff --git a/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/const.py b/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/const.py new file mode 100644 index 00000000000..e27e7289a02 --- /dev/null +++ b/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/const.py @@ -0,0 +1,14 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# Replaced mock values +MOCKED_SUBSCRIPTION_ID = '00000000-0000-0000-0000-000000000000' +MOCKED_TENANT_ID = '00000000-0000-0000-0000-000000000000' + +# Configuration environment variable +ENV_COMMAND_COVERAGE = 'AZURE_TEST_COMMAND_COVERAGE' +ENV_LIVE_TEST = 'AZURE_TEST_RUN_LIVE' +ENV_SKIP_ASSERT = 'AZURE_TEST_SKIP_ASSERT' +ENV_TEST_DIAGNOSE = 'AZURE_TEST_DIAGNOSE' diff --git a/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/decorators.py b/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/decorators.py new file mode 100644 index 00000000000..7f693046787 --- /dev/null +++ b/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/decorators.py @@ -0,0 +1,44 @@ +# -------------------------------------------------------------------------------------------- +# 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 functools +import unittest +from .const import ENV_LIVE_TEST +from .utilities import trim_kwargs_from_test_function + + +def live_only(): + return unittest.skipUnless( + os.environ.get(ENV_LIVE_TEST, False), + 'This is a live only test. A live test will bypass all vcrpy components.') + + +def record_only(): + return unittest.skipUnless( + not os.environ.get(ENV_LIVE_TEST, False), + 'This test is excluded from being run live. To force a recording, please remove the recording file.') + + +class AllowLargeResponse(object): # pylint: disable=too-few-public-methods + + def __init__(self, size_kb=1024): + self.size_kb = size_kb + + def __call__(self, fn): + def _preparer_wrapper(test_class_instance, **kwargs): + from .recording_processors import LargeResponseBodyProcessor + large_resp_body = next((r for r in test_class_instance.recording_processors + if isinstance(r, LargeResponseBodyProcessor)), None) + if large_resp_body: + large_resp_body._max_response_body = self.size_kb # pylint: disable=protected-access + + trim_kwargs_from_test_function(fn, kwargs) + + fn(test_class_instance, **kwargs) + + setattr(_preparer_wrapper, '__is_preparer', True) + functools.update_wrapper(_preparer_wrapper, fn) + return _preparer_wrapper diff --git a/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/exceptions.py b/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/exceptions.py new file mode 100644 index 00000000000..bdebae0b44e --- /dev/null +++ b/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/exceptions.py @@ -0,0 +1,10 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +class AzureTestError(Exception): + def __init__(self, error_message): + message = 'An error caused by the Azure test harness failed the test: {}' + super(AzureTestError, self).__init__(message.format(error_message)) diff --git a/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/patches.py b/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/patches.py new file mode 100644 index 00000000000..ba3d95c7d35 --- /dev/null +++ b/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/patches.py @@ -0,0 +1,37 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from .exceptions import AzureTestError + + +def patch_time_sleep_api(unit_test): + def _time_sleep_skip(*_): + return + + mock_in_unit_test(unit_test, 'time.sleep', _time_sleep_skip) + + +def patch_long_run_operation_delay(unit_test): + def _shortcut_long_run_operation(*args, **kwargs): # pylint: disable=unused-argument + return + + mock_in_unit_test(unit_test, + 'msrestazure.azure_operation.AzureOperationPoller._delay', + _shortcut_long_run_operation) + + +def mock_in_unit_test(unit_test, target, replacement): + try: + import unittest.mock as mock + except ImportError: + import mock + import unittest + + if not isinstance(unit_test, unittest.TestCase): + raise AzureTestError('Patches can be only called from a unit test') + + mp = mock.patch(target, replacement) + mp.__enter__() + unit_test.addCleanup(mp.__exit__, None, None, None) diff --git a/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/preparers.py b/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/preparers.py new file mode 100644 index 00000000000..593e1b43e01 --- /dev/null +++ b/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/preparers.py @@ -0,0 +1,122 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import contextlib +import functools + +from .base import ReplayableTest +from .utilities import create_random_name, is_text_payload, trim_kwargs_from_test_function +from .recording_processors import RecordingProcessor + + +# Core Utility + +class AbstractPreparer(object): + def __init__(self, name_prefix, name_len, disable_recording=False): + self.name_prefix = name_prefix + self.name_len = name_len + self.resource_moniker = None + self.resource_random_name = None + self.test_class_instance = None + self.live_test = False + self.disable_recording = disable_recording + + def __call__(self, fn): + def _preparer_wrapper(test_class_instance, **kwargs): + self.live_test = not isinstance(test_class_instance, ReplayableTest) + self.test_class_instance = test_class_instance + + if self.live_test or test_class_instance.in_recording: + resource_name = self.random_name + if not self.live_test and isinstance(self, RecordingProcessor): + test_class_instance.recording_processors.append(self) + else: + resource_name = self.moniker + + with self.override_disable_recording(): + parameter_update = self.create_resource( + resource_name, + **kwargs + ) + + if parameter_update: + kwargs.update(parameter_update) + + trim_kwargs_from_test_function(fn, kwargs) + + try: + fn(test_class_instance, **kwargs) + finally: + # Russian Doll - the last declared resource to be deleted first. + self.remove_resource_with_record_override(resource_name, **kwargs) + + setattr(_preparer_wrapper, '__is_preparer', True) + functools.update_wrapper(_preparer_wrapper, fn) + return _preparer_wrapper + + @contextlib.contextmanager + def override_disable_recording(self): + if hasattr(self.test_class_instance, 'disable_recording'): + orig_enabled = self.test_class_instance.disable_recording + self.test_class_instance.disable_recording = self.disable_recording + yield + self.test_class_instance.disable_recording = orig_enabled + else: + yield + + @property + def moniker(self): + if not self.resource_moniker: + self.test_class_instance.test_resources_count += 1 + self.resource_moniker = '{}{:06}'.format(self.name_prefix, + self.test_class_instance.test_resources_count) + return self.resource_moniker + + def create_random_name(self): + return create_random_name(self.name_prefix, self.name_len) + + @property + def random_name(self): + if not self.resource_random_name: + self.resource_random_name = self.create_random_name() + return self.resource_random_name + + def create_resource(self, name, **kwargs): # pylint: disable=unused-argument,no-self-use + return {} + + def remove_resource(self, name, **kwargs): # pylint: disable=unused-argument + pass + + def remove_resource_with_record_override(self, name, **kwargs): + with self.override_disable_recording(): + self.remove_resource(name, **kwargs) + + +class SingleValueReplacer(RecordingProcessor): + # pylint: disable=no-member + def process_request(self, request): + from six.moves.urllib_parse import quote_plus # pylint: disable=import-error, relative-import + if self.random_name in request.uri: + request.uri = request.uri.replace(self.random_name, self.moniker) + elif quote_plus(self.random_name) in request.uri: + request.uri = request.uri.replace(quote_plus(self.random_name), + quote_plus(self.moniker)) + + if is_text_payload(request) and request.body: + body = str(request.body, 'utf-8') if isinstance(request.body, bytes) else str(request.body) + if self.random_name in body: + request.body = body.replace(self.random_name, self.moniker) + + return request + + def process_response(self, response): + if is_text_payload(response) and response['body']['string']: + response['body']['string'] = response['body']['string'].replace(self.random_name, + self.moniker) + + self.replace_header(response, 'location', self.random_name, self.moniker) + self.replace_header(response, 'azure-asyncoperation', self.random_name, self.moniker) + + return response diff --git a/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/recording_processors.py b/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/recording_processors.py new file mode 100644 index 00000000000..376531d0b45 --- /dev/null +++ b/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/recording_processors.py @@ -0,0 +1,205 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from .utilities import is_text_payload, is_json_payload + + +class RecordingProcessor(object): + def process_request(self, request): # pylint: disable=no-self-use + return request + + def process_response(self, response): # pylint: disable=no-self-use + return response + + @classmethod + def replace_header(cls, entity, header, old, new): + cls.replace_header_fn(entity, header, lambda v: v.replace(old, new)) + + @classmethod + def replace_header_fn(cls, entity, header, replace_fn): + # Loop over the headers to find the one we want case insensitively, + # but we don't want to modify the case of original header key. + for key, values in entity['headers'].items(): + if key.lower() == header.lower(): + entity['headers'][key] = [replace_fn(v) for v in values] + + +class SubscriptionRecordingProcessor(RecordingProcessor): + def __init__(self, replacement): + self._replacement = replacement + + def process_request(self, request): + request.uri = self._replace_subscription_id(request.uri) + + if is_text_payload(request) and request.body: + request.body = self._replace_subscription_id(request.body.decode()).encode() + + return request + + def process_response(self, response): + if is_text_payload(response) and response['body']['string']: + response['body']['string'] = self._replace_subscription_id(response['body']['string']) + + self.replace_header_fn(response, 'location', self._replace_subscription_id) + self.replace_header_fn(response, 'azure-asyncoperation', self._replace_subscription_id) + + return response + + def _replace_subscription_id(self, val): + import re + # subscription presents in all api call + retval = re.sub('/(subscriptions)/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}', + r'/\1/{}'.format(self._replacement), + val, + flags=re.IGNORECASE) + + # subscription is also used in graph call + retval = re.sub('https://(graph.windows.net)/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}', + r'https://\1/{}'.format(self._replacement), + retval, + flags=re.IGNORECASE) + + # subscription presents in private dns is abnormal + retval = re.sub(r'\\/(subscriptions)\\/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}', + r'\\/\1\\/{}'.format(self._replacement), + retval, + flags=re.IGNORECASE) + return retval + + +class LargeRequestBodyProcessor(RecordingProcessor): + def __init__(self, max_request_body=128): + self._max_request_body = max_request_body + + def process_request(self, request): + if is_text_payload(request) and request.body and len(request.body) > self._max_request_body * 1024: + request.body = '!!! The request body has been omitted from the recording because its ' \ + 'size {} is larger than {}KB. !!!'.format(len(request.body), + self._max_request_body) + + return request + + +class LargeResponseBodyProcessor(RecordingProcessor): + control_flag = '' + + def __init__(self, max_response_body=128): + self._max_response_body = max_response_body + + def process_response(self, response): + if is_text_payload(response): + length = len(response['body']['string'] or '') + if length > self._max_response_body * 1024: + + if is_json_payload(response): + from .decorators import AllowLargeResponse # pylint: disable=cyclic-import + raise ValueError("The json response body exceeds the default limit of {}kb. Use '@{}' " + "on your test method to increase the limit or update test logics to avoid " + "big payloads".format(self._max_response_body, AllowLargeResponse.__name__)) + + response['body']['string'] = \ + "!!! The response body has been omitted from the recording because it is larger " \ + "than {max_body} KB. It will be replaced with blank content of {length} bytes while replay. " \ + "{flag}{length}".format(max_body=self._max_response_body, length=length, flag=self.control_flag) + return response + + +class LargeResponseBodyReplacer(RecordingProcessor): + def process_response(self, response): + if is_text_payload(response) and not is_json_payload(response): + import six + body = response['body']['string'] + + # backward compatibility. under 2.7 response body is unicode, under 3.5 response body is + # bytes. when set the value back, the same type must be used. + body_is_string = isinstance(body, six.string_types) + + content_in_string = (response['body']['string'] or b'').decode('utf-8') + index = content_in_string.find(LargeResponseBodyProcessor.control_flag) + + if index > -1: + length = int(content_in_string[index + len(LargeResponseBodyProcessor.control_flag):]) + if body_is_string: + response['body']['string'] = '0' * length + else: + response['body']['string'] = bytes([0] * length) + + return response + + +class OAuthRequestResponsesFilter(RecordingProcessor): + """Remove oauth authentication requests and responses from recording.""" + + def process_request(self, request): + # filter request like: + # GET https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/token + import re + if not re.match('https://login.microsoftonline.com/([^/]+)/oauth2/token', request.uri): + return request + return None + + +class DeploymentNameReplacer(RecordingProcessor): + """Replace the random deployment name with a fixed mock name.""" + + def process_request(self, request): + import re + request.uri = re.sub('/deployments/([^/?]+)', '/deployments/mock-deployment', request.uri) + return request + + +class AccessTokenReplacer(RecordingProcessor): + """Replace the access token for service principal authentication in a response body.""" + + def __init__(self, replacement='fake_token'): + self._replacement = replacement + + def process_response(self, response): + import json + try: + body = json.loads(response['body']['string']) + body['access_token'] = self._replacement + except (KeyError, ValueError): + return response + response['body']['string'] = json.dumps(body) + return response + + +class GeneralNameReplacer(RecordingProcessor): + def __init__(self): + self.names_name = [] + + def register_name_pair(self, old, new): + self.names_name.append((old, new)) + + def process_request(self, request): + for old, new in self.names_name: + request.uri = request.uri.replace(old, new) + + if is_text_payload(request) and request.body: + body = str(request.body) + if old in body: + request.body = body.replace(old, new) + + return request + + def process_response(self, response): + for old, new in self.names_name: + if is_text_payload(response) and response['body']['string']: + response['body']['string'] = response['body']['string'].replace(old, new) + + self.replace_header(response, 'location', old, new) + self.replace_header(response, 'azure-asyncoperation', old, new) + + return response + + +class RequestUrlNormalizer(RecordingProcessor): + """URL parsing fix to account for '//' vs '/' in different versions of python""" + + def process_request(self, request): + import re + request.uri = re.sub('(? length: + raise ValueError('The length of the prefix must not be longer than random name length') + + padding_size = length - len(prefix) + if padding_size < 4: + raise ValueError('The randomized part of the name is shorter than 4, which may not be able to offer enough ' + 'randomness') + + random_bytes = os.urandom(int(math.ceil(float(padding_size) / 8) * 5)) + random_padding = base64.b32encode(random_bytes)[:padding_size] + + return str(prefix + random_padding.decode().lower()) + + +def get_sha1_hash(file_path): + sha1 = hashlib.sha256() + with open(file_path, 'rb') as f: + while True: + data = f.read(65536) + if not data: + break + sha1.update(data) + + return sha1.hexdigest() + + +def _get_content_type(entity): + # 'headers' is a field of 'request', but it is a dict-key in 'response' + headers = getattr(entity, 'headers', None) + if headers is None: + headers = entity.get('headers') + + content_type = None + if headers: + content_type = headers.get('content-type', None) + if content_type: + # content-type could an array from response, let us extract it out + content_type = content_type[0] if isinstance(content_type, list) else content_type + content_type = content_type.split(";")[0].lower() + return content_type + + +def is_text_payload(entity): + text_content_list = ['application/json', 'application/xml', 'text/', 'application/test-content'] + + content_type = _get_content_type(entity) + if content_type: + return any(content_type.startswith(x) for x in text_content_list) + return True + + +def is_json_payload(entity): + return _get_content_type(entity) == 'application/json' + + +def trim_kwargs_from_test_function(fn, kwargs): + # the next function is the actual test function. the kwargs need to be trimmed so + # that parameters which are not required will not be passed to it. + if not is_preparer_func(fn): + args, _, kw, _ = inspect.getargspec(fn) # pylint: disable=deprecated-method + if kw is None: + args = set(args) + for key in [k for k in kwargs if k not in args]: + del kwargs[key] + + +def is_preparer_func(fn): + return getattr(fn, '__is_preparer', False) diff --git a/src/azure-cli-testsdk/azure/cli/testsdk/utilities.py b/src/azure-cli-testsdk/azure/cli/testsdk/utilities.py index 722df74b879..0c79c833d9b 100644 --- a/src/azure-cli-testsdk/azure/cli/testsdk/utilities.py +++ b/src/azure-cli-testsdk/azure/cli/testsdk/utilities.py @@ -6,9 +6,9 @@ import os from contextlib import contextmanager -from azure_devtools.scenario_tests import (create_random_name as create_random_name_base, RecordingProcessor, - GeneralNameReplacer as _BuggyGeneralNameReplacer) -from azure_devtools.scenario_tests.utilities import is_text_payload +from .scenario_tests import (create_random_name as create_random_name_base, RecordingProcessor, + GeneralNameReplacer as _BuggyGeneralNameReplacer) +from .scenario_tests.utilities import is_text_payload def create_random_name(prefix='clitest', length=24): @@ -202,7 +202,7 @@ def process_request(self, request): class AADAuthRequestFilter(RecordingProcessor): """Remove oauth authentication requests and responses from recording. - This is a patch for azure_devtools.scenario_tests.recording_processors.OAuthRequestResponsesFilter + This is derived from OAuthRequestResponsesFilter. """ def process_request(self, request): # filter AAD requests like: diff --git a/src/azure-cli-testsdk/setup.py b/src/azure-cli-testsdk/setup.py index 04b7606b06e..5b120c4b59b 100644 --- a/src/azure-cli-testsdk/setup.py +++ b/src/azure-cli-testsdk/setup.py @@ -26,7 +26,6 @@ DEPENDENCIES = [ 'jmespath', 'vcrpy>=1.10.3', - 'azure-devtools==1.2.0', 'pytest' ] diff --git a/src/azure-cli/azure/cli/command_modules/acr/tests/hybrid_2020_09_01/test_acr_commands.py b/src/azure-cli/azure/cli/command_modules/acr/tests/hybrid_2020_09_01/test_acr_commands.py index 0318e2d4c54..d3b998f3e9f 100644 --- a/src/azure-cli/azure/cli/command_modules/acr/tests/hybrid_2020_09_01/test_acr_commands.py +++ b/src/azure-cli/azure/cli/command_modules/acr/tests/hybrid_2020_09_01/test_acr_commands.py @@ -3,7 +3,7 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer, KeyVaultPreparer, record_only from azure.cli.command_modules.acr.custom import DEF_DIAG_SETTINGS_NAME_TEMPLATE diff --git a/src/azure-cli/azure/cli/command_modules/acr/tests/latest/test_acr_commands.py b/src/azure-cli/azure/cli/command_modules/acr/tests/latest/test_acr_commands.py index 0d1c36f03bf..07c7228b35a 100644 --- a/src/azure-cli/azure/cli/command_modules/acr/tests/latest/test_acr_commands.py +++ b/src/azure-cli/azure/cli/command_modules/acr/tests/latest/test_acr_commands.py @@ -3,7 +3,7 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer, KeyVaultPreparer, record_only from azure.cli.command_modules.acr.custom import DEF_DIAG_SETTINGS_NAME_TEMPLATE diff --git a/src/azure-cli/azure/cli/command_modules/acr/tests/latest/test_acr_token.py b/src/azure-cli/azure/cli/command_modules/acr/tests/latest/test_acr_token.py index c03ea18476f..50bd8a5ae59 100644 --- a/src/azure-cli/azure/cli/command_modules/acr/tests/latest/test_acr_token.py +++ b/src/azure-cli/azure/cli/command_modules/acr/tests/latest/test_acr_token.py @@ -5,7 +5,7 @@ import datetime import unittest -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer diff --git a/src/azure-cli/azure/cli/command_modules/acs/tests/hybrid_2020_09_01/recording_processors.py b/src/azure-cli/azure/cli/command_modules/acs/tests/hybrid_2020_09_01/recording_processors.py index 78526209c05..90fbd9131e0 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/tests/hybrid_2020_09_01/recording_processors.py +++ b/src/azure-cli/azure/cli/command_modules/acs/tests/hybrid_2020_09_01/recording_processors.py @@ -3,8 +3,8 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -from azure_devtools.scenario_tests import RecordingProcessor -from azure_devtools.scenario_tests.utilities import is_text_payload +from azure.cli.testsdk.scenario_tests import RecordingProcessor +from azure.cli.testsdk.scenario_tests.utilities import is_text_payload MOCK_GUID = '00000000-0000-0000-0000-000000000001' MOCK_SECRET = 'fake-secret' diff --git a/src/azure-cli/azure/cli/command_modules/acs/tests/hybrid_2020_09_01/test_acs_commands.py b/src/azure-cli/azure/cli/command_modules/acs/tests/hybrid_2020_09_01/test_acs_commands.py index 818021d5c27..6822a0ff10b 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/tests/hybrid_2020_09_01/test_acs_commands.py +++ b/src/azure-cli/azure/cli/command_modules/acs/tests/hybrid_2020_09_01/test_acs_commands.py @@ -9,7 +9,7 @@ from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer, RoleBasedServicePrincipalPreparer, live_only) -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse # flake8: noqa AZURE_TEST_RUN_LIVE = bool(os.environ.get('AZURE_TEST_RUN_LIVE')) diff --git a/src/azure-cli/azure/cli/command_modules/acs/tests/hybrid_2020_09_01/test_aks_commands.py b/src/azure-cli/azure/cli/command_modules/acs/tests/hybrid_2020_09_01/test_aks_commands.py index 9d4eaa5770e..6235992f12c 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/tests/hybrid_2020_09_01/test_aks_commands.py +++ b/src/azure-cli/azure/cli/command_modules/acs/tests/hybrid_2020_09_01/test_aks_commands.py @@ -11,7 +11,7 @@ from azure.cli.testsdk import ( ResourceGroupPreparer, RoleBasedServicePrincipalPreparer, VirtualNetworkPreparer, ScenarioTest, live_only) -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse from azure.cli.testsdk.checkers import ( StringContainCheck, StringContainCheckIgnoreCase) from azure.cli.command_modules.acs._format import version_to_tuple @@ -545,4 +545,4 @@ def generate_user_assigned_identity_resource_id(self, resource_group): self.exists('nodeResourceGroup'), self.check('provisioningState', 'Succeeded'), self.check('apiServerAccessProfile.privateDnsZone', zone_id), - ]) \ No newline at end of file + ]) diff --git a/src/azure-cli/azure/cli/command_modules/acs/tests/latest/recording_processors.py b/src/azure-cli/azure/cli/command_modules/acs/tests/latest/recording_processors.py index 78526209c05..90fbd9131e0 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/tests/latest/recording_processors.py +++ b/src/azure-cli/azure/cli/command_modules/acs/tests/latest/recording_processors.py @@ -3,8 +3,8 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -from azure_devtools.scenario_tests import RecordingProcessor -from azure_devtools.scenario_tests.utilities import is_text_payload +from azure.cli.testsdk.scenario_tests import RecordingProcessor +from azure.cli.testsdk.scenario_tests.utilities import is_text_payload MOCK_GUID = '00000000-0000-0000-0000-000000000001' MOCK_SECRET = 'fake-secret' diff --git a/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_acs_commands.py b/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_acs_commands.py index 818021d5c27..6822a0ff10b 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_acs_commands.py +++ b/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_acs_commands.py @@ -9,7 +9,7 @@ from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer, RoleBasedServicePrincipalPreparer, live_only) -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse # flake8: noqa AZURE_TEST_RUN_LIVE = bool(os.environ.get('AZURE_TEST_RUN_LIVE')) diff --git a/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_aks_commands.py b/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_aks_commands.py index 6c431fa847d..e79d894d8b3 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_aks_commands.py +++ b/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_aks_commands.py @@ -13,7 +13,7 @@ from azure.cli.core.azclierror import CLIInternalError from azure.cli.testsdk import ScenarioTest, live_only -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse from azure.cli.testsdk.checkers import ( StringCheck, StringContainCheck, diff --git a/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_osa_commands.py b/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_osa_commands.py index dd988c64625..de73d57e360 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_osa_commands.py +++ b/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_osa_commands.py @@ -11,7 +11,7 @@ from azure.cli.testsdk import ( ResourceGroupPreparer, ManagedApplicationPreparer, ScenarioTest, live_only) -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse from azure.cli.testsdk.checkers import (StringContainCheck, StringContainCheckIgnoreCase) # flake8: noqa @@ -171,7 +171,7 @@ def test_openshift_create_with_monitoring(self, resource_group, resource_group_l workspace_id = workspace["id"] account = self.cmd("account show").get_output_in_json() tenant_id = account["tenantId"] - self.kwargs.update({ + self.kwargs.update({ 'workspace_id': workspace_id, 'tenant_id': tenant_id }) @@ -241,4 +241,3 @@ def test_openshift_monitoring_enable(self, resource_group, resource_group_locati # delete self.cmd('openshift delete -g {resource_group} -n {name} --yes --no-wait', checks=[self.is_empty()]) - diff --git a/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_run_command.py b/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_run_command.py index 3123028d5ec..d300ed3cbbb 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_run_command.py +++ b/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_run_command.py @@ -9,7 +9,7 @@ from azure.cli.command_modules.acs.custom import _get_command_context from azure.cli.testsdk import ( ResourceGroupPreparer, RoleBasedServicePrincipalPreparer, ScenarioTest, live_only) -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse from azure.cli.testsdk.checkers import ( StringContainCheck, StringContainCheckIgnoreCase) diff --git a/src/azure-cli/azure/cli/command_modules/ams/tests/latest/test_ams_sp_scenarios.py b/src/azure-cli/azure/cli/command_modules/ams/tests/latest/test_ams_sp_scenarios.py index f24ce881da0..b4cea3a0323 100644 --- a/src/azure-cli/azure/cli/command_modules/ams/tests/latest/test_ams_sp_scenarios.py +++ b/src/azure-cli/azure/cli/command_modules/ams/tests/latest/test_ams_sp_scenarios.py @@ -7,7 +7,7 @@ from unittest import mock from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer, StorageAccountPreparer -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse class AmsSpTests(ScenarioTest): @ResourceGroupPreparer() @@ -48,7 +48,7 @@ def test_ams_sp_create_reset(self, resource_group, storage_account_for_create): # Wait 2 minutes for role assignment to be created. time.sleep(300) - + self.cmd('az ams account sp reset-credentials -a {amsname} -g {rg} -n {appId} -p {spNewPassword}', checks=[ self.check('AadSecret', '{spNewPassword}'), self.check('ResourceGroup', '{rg}'), diff --git a/src/azure-cli/azure/cli/command_modules/apim/tests/latest/test_apim_scenario.py b/src/azure-cli/azure/cli/command_modules/apim/tests/latest/test_apim_scenario.py index 39f8c86d248..c02c6a47ed7 100644 --- a/src/azure-cli/azure/cli/command_modules/apim/tests/latest/test_apim_scenario.py +++ b/src/azure-cli/azure/cli/command_modules/apim/tests/latest/test_apim_scenario.py @@ -5,7 +5,7 @@ import os import unittest -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer, StorageAccountPreparer) diff --git a/src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/test_appconfig_commands.py b/src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/test_appconfig_commands.py index 351fc42584f..a084b765203 100644 --- a/src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/test_appconfig_commands.py +++ b/src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/test_appconfig_commands.py @@ -16,7 +16,7 @@ from azure.cli.testsdk import (ResourceGroupPreparer, ScenarioTest, KeyVaultPreparer, live_only, LiveScenarioTest) from azure.cli.testsdk.checkers import NoneCheck from azure.cli.command_modules.appconfig._constants import FeatureFlagConstants, KeyVaultConstants, ImportExportProfiles -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) diff --git a/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands.py b/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands.py index 396d2673551..46c0e9ce808 100644 --- a/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands.py +++ b/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands.py @@ -11,7 +11,7 @@ import requests import datetime -from azure_devtools.scenario_tests import AllowLargeResponse, record_only +from azure.cli.testsdk.scenario_tests import AllowLargeResponse, record_only from azure.cli.testsdk import (ScenarioTest, LocalContextScenarioTest, LiveScenarioTest, ResourceGroupPreparer, StorageAccountPreparer, JMESPathCheck, live_only) from azure.cli.testsdk.checkers import JMESPathCheckNotExists, JMESPathPatternCheck diff --git a/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_logicapp_commands.py b/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_logicapp_commands.py index b7d4709b9dc..5b053101490 100644 --- a/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_logicapp_commands.py +++ b/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_logicapp_commands.py @@ -11,7 +11,7 @@ import requests import datetime -from azure_devtools.scenario_tests import AllowLargeResponse, record_only +from azure.cli.testsdk.scenario_tests import AllowLargeResponse, record_only from azure.cli.testsdk import (ScenarioTest, LocalContextScenarioTest, LiveScenarioTest, ResourceGroupPreparer, StorageAccountPreparer, JMESPathCheck, live_only) from azure.cli.testsdk.checkers import JMESPathPatternCheck @@ -26,7 +26,7 @@ DEFAULT_LOCATION = "westus" class LogicappBasicE2ETest(ScenarioTest): - + @ResourceGroupPreparer(location=DEFAULT_LOCATION) def test_logicapp_e2e(self, resource_group): logicapp_name = self.create_random_name(prefix='logic-e2e', length=24) @@ -36,7 +36,7 @@ def test_logicapp_e2e(self, resource_group): self.cmd('appservice plan list -g {}'.format(resource_group)) self.cmd('storage account create --name {} -g {} -l {} --sku Standard_LRS'.format(storage, resource_group, DEFAULT_LOCATION)) - self.cmd('logicapp create -g {} -n {} -p {} -s {}'.format(resource_group, logicapp_name, plan, storage), + self.cmd('logicapp create -g {} -n {} -p {} -s {}'.format(resource_group, logicapp_name, plan, storage), checks=[ JMESPathCheck('state', 'Running'), JMESPathCheck('name', logicapp_name), @@ -145,7 +145,7 @@ def test_logicapp_on_linux(self, resource_group, storage_account): ]).get_output_in_json() # self.assertTrue('functionapp,workflowapp,linux' in result[0]['kind']) - + self.cmd('logicapp delete -g {} -n {} -y'.format(resource_group, logicapp_name)) diff --git a/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_access_restriction_commands.py b/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_access_restriction_commands.py index 3a10c7d9101..3ce5636c037 100644 --- a/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_access_restriction_commands.py +++ b/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_access_restriction_commands.py @@ -9,7 +9,7 @@ import json import unittest import jmespath -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse from azure.cli.core.azclierror import (ResourceNotFoundError, ArgumentUsageError, InvalidArgumentValueError, MutuallyExclusiveArgumentError) from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer, JMESPathCheck) diff --git a/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_commands.py b/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_commands.py index 387eab29aa5..d77916a07fc 100644 --- a/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_commands.py +++ b/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_commands.py @@ -9,14 +9,14 @@ import os import time import tempfile -from azure_devtools.scenario_tests.utilities import create_random_name +from azure.cli.testsdk.scenario_tests.utilities import create_random_name import requests import datetime import urllib3 from knack.util import CLIError import certifi -from azure_devtools.scenario_tests import AllowLargeResponse, record_only +from azure.cli.testsdk.scenario_tests import AllowLargeResponse, record_only from azure.cli.testsdk import (ScenarioTest, LocalContextScenarioTest, LiveScenarioTest, ResourceGroupPreparer, StorageAccountPreparer, KeyVaultPreparer, JMESPathCheck, live_only) from azure.cli.testsdk.checkers import JMESPathCheckNotExists diff --git a/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_up_commands.py b/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_up_commands.py index bf7d536612d..a2d1567c3cd 100644 --- a/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_up_commands.py +++ b/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_up_commands.py @@ -10,7 +10,7 @@ import os import requests -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse from azure.cli.testsdk import ( ScenarioTest, ResourceGroupPreparer, JMESPathCheck, live_only) diff --git a/src/azure-cli/azure/cli/command_modules/aro/tests/latest/test_aro_commands.py b/src/azure-cli/azure/cli/command_modules/aro/tests/latest/test_aro_commands.py index 8cefcf6859f..f02d1eabdad 100644 --- a/src/azure-cli/azure/cli/command_modules/aro/tests/latest/test_aro_commands.py +++ b/src/azure-cli/azure/cli/command_modules/aro/tests/latest/test_aro_commands.py @@ -12,7 +12,7 @@ from knack.log import get_logger from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer from azure.cli.testsdk.checkers import StringContainCheck -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse logger = get_logger(__name__) diff --git a/src/azure-cli/azure/cli/command_modules/backup/tests/latest/test_backup_commands.py b/src/azure-cli/azure/cli/command_modules/backup/tests/latest/test_backup_commands.py index 45e7ee65edf..276647d43ed 100644 --- a/src/azure-cli/azure/cli/command_modules/backup/tests/latest/test_backup_commands.py +++ b/src/azure-cli/azure/cli/command_modules/backup/tests/latest/test_backup_commands.py @@ -11,7 +11,7 @@ from azure.cli.testsdk import ScenarioTest, JMESPathCheckExists, ResourceGroupPreparer, \ StorageAccountPreparer, KeyVaultPreparer, record_only from azure.mgmt.recoveryservicesbackup.models import StorageType -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse from .preparers import VaultPreparer, VMPreparer, ItemPreparer, PolicyPreparer, RPPreparer @@ -1074,8 +1074,3 @@ def test_backup_encryption(self, resource_group, resource_group_location, vault1 self.check('properties.useSystemAssignedIdentity', False), self.check('properties.lastUpdateStatus', 'Succeeded') ]) - - - - - diff --git a/src/azure-cli/azure/cli/command_modules/batch/tests/latest/recording_processors.py b/src/azure-cli/azure/cli/command_modules/batch/tests/latest/recording_processors.py index ce7e7b27af8..599b9f75ee5 100644 --- a/src/azure-cli/azure/cli/command_modules/batch/tests/latest/recording_processors.py +++ b/src/azure-cli/azure/cli/command_modules/batch/tests/latest/recording_processors.py @@ -6,8 +6,8 @@ import re import json -from azure_devtools.scenario_tests.utilities import is_text_payload -from azure_devtools.scenario_tests import RecordingProcessor +from azure.cli.testsdk.scenario_tests.utilities import is_text_payload +from azure.cli.testsdk.scenario_tests import RecordingProcessor class StorageSASReplacer(RecordingProcessor): diff --git a/src/azure-cli/azure/cli/command_modules/batch/tests/latest/test_batch_mgmt_commands.py b/src/azure-cli/azure/cli/command_modules/batch/tests/latest/test_batch_mgmt_commands.py index dbbf109cd4a..ffeeb21571c 100644 --- a/src/azure-cli/azure/cli/command_modules/batch/tests/latest/test_batch_mgmt_commands.py +++ b/src/azure-cli/azure/cli/command_modules/batch/tests/latest/test_batch_mgmt_commands.py @@ -8,7 +8,7 @@ from azure.cli.testsdk import ( ScenarioTest, ResourceGroupPreparer, LiveScenarioTest) -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse from azure.cli.core.profiles import ResourceType, get_sdk from .recording_processors import BatchAccountKeyReplacer, StorageSASReplacer diff --git a/src/azure-cli/azure/cli/command_modules/batchai/tests/latest/test_batchai_scenario.py b/src/azure-cli/azure/cli/command_modules/batchai/tests/latest/test_batchai_scenario.py index 4928481de1c..19d22e6fbd9 100644 --- a/src/azure-cli/azure/cli/command_modules/batchai/tests/latest/test_batchai_scenario.py +++ b/src/azure-cli/azure/cli/command_modules/batchai/tests/latest/test_batchai_scenario.py @@ -12,7 +12,7 @@ from unittest import mock from azure.cli.testsdk import JMESPathCheck, JMESPathCheckExists, StringContainCheck -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse NODE_STARTUP_TIME = 10 * 60 # Compute node should start in 10 mins after cluster creation. CLUSTER_RESIZE_TIME = 20 * 60 # Cluster should resize in 20 mins after job submitted/completed. diff --git a/src/azure-cli/azure/cli/command_modules/cognitiveservices/tests/latest/test_cognitiveservices_command.py b/src/azure-cli/azure/cli/command_modules/cognitiveservices/tests/latest/test_cognitiveservices_command.py index ce9dcad1a89..5e220226694 100644 --- a/src/azure-cli/azure/cli/command_modules/cognitiveservices/tests/latest/test_cognitiveservices_command.py +++ b/src/azure-cli/azure/cli/command_modules/cognitiveservices/tests/latest/test_cognitiveservices_command.py @@ -6,7 +6,7 @@ import unittest from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse from knack.util import CLIError diff --git a/src/azure-cli/azure/cli/command_modules/cognitiveservices/tests/latest/test_cognitiveservices_softdelete.py b/src/azure-cli/azure/cli/command_modules/cognitiveservices/tests/latest/test_cognitiveservices_softdelete.py index 4b40acd091d..59721ffb39c 100644 --- a/src/azure-cli/azure/cli/command_modules/cognitiveservices/tests/latest/test_cognitiveservices_softdelete.py +++ b/src/azure-cli/azure/cli/command_modules/cognitiveservices/tests/latest/test_cognitiveservices_softdelete.py @@ -7,7 +7,7 @@ import unittest from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse from knack.util import CLIError diff --git a/src/azure-cli/azure/cli/command_modules/consumption/tests/latest/test_consumption_commands.py b/src/azure-cli/azure/cli/command_modules/consumption/tests/latest/test_consumption_commands.py index 56d45d15250..8cb95463437 100644 --- a/src/azure-cli/azure/cli/command_modules/consumption/tests/latest/test_consumption_commands.py +++ b/src/azure-cli/azure/cli/command_modules/consumption/tests/latest/test_consumption_commands.py @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- # pylint: disable=line-too-long from datetime import datetime -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse from azure.cli.testsdk import ScenarioTest, record_only diff --git a/src/azure-cli/azure/cli/command_modules/cosmosdb/tests/latest/test_cosmosdb_cassandrami_scenario.py b/src/azure-cli/azure/cli/command_modules/cosmosdb/tests/latest/test_cosmosdb_cassandrami_scenario.py index 810aa1691ad..4e65e09643d 100644 --- a/src/azure-cli/azure/cli/command_modules/cosmosdb/tests/latest/test_cosmosdb_cassandrami_scenario.py +++ b/src/azure-cli/azure/cli/command_modules/cosmosdb/tests/latest/test_cosmosdb_cassandrami_scenario.py @@ -7,7 +7,7 @@ from unittest import mock from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer) -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) @@ -128,4 +128,4 @@ def create_subnet(self, resource_group): subnet_resource = self.cmd('az network vnet subnet show -g {rg} --vnet-name {vnet} --name {subnet}').get_output_in_json() subnet_id = subnet_resource['id'] - return subnet_id \ No newline at end of file + return subnet_id diff --git a/src/azure-cli/azure/cli/command_modules/cosmosdb/tests/latest/test_cosmosdb_commands.py b/src/azure-cli/azure/cli/command_modules/cosmosdb/tests/latest/test_cosmosdb_commands.py index ebad5083104..1af1625a1c0 100644 --- a/src/azure-cli/azure/cli/command_modules/cosmosdb/tests/latest/test_cosmosdb_commands.py +++ b/src/azure-cli/azure/cli/command_modules/cosmosdb/tests/latest/test_cosmosdb_commands.py @@ -7,7 +7,7 @@ from azure.cli.testsdk import JMESPathCheck, ScenarioTest, ResourceGroupPreparer, KeyVaultPreparer from knack.util import CLIError -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse from datetime import datetime, timedelta, timezone from dateutil import parser diff --git a/src/azure-cli/azure/cli/command_modules/deploymentmanager/tests/latest/test_deploymentmanager_scenario.py b/src/azure-cli/azure/cli/command_modules/deploymentmanager/tests/latest/test_deploymentmanager_scenario.py index a67459dc54c..7bcc10721f3 100644 --- a/src/azure-cli/azure/cli/command_modules/deploymentmanager/tests/latest/test_deploymentmanager_scenario.py +++ b/src/azure-cli/azure/cli/command_modules/deploymentmanager/tests/latest/test_deploymentmanager_scenario.py @@ -18,7 +18,7 @@ StorageAccountPreparer) from msrestazure.azure_exceptions import CloudError -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse name_prefix = 'cliadm' resource_location = 'centralus' diff --git a/src/azure-cli/azure/cli/command_modules/dla/tests/latest/recording_processors.py b/src/azure-cli/azure/cli/command_modules/dla/tests/latest/recording_processors.py index 5c598a9fea1..514ba511e1b 100644 --- a/src/azure-cli/azure/cli/command_modules/dla/tests/latest/recording_processors.py +++ b/src/azure-cli/azure/cli/command_modules/dla/tests/latest/recording_processors.py @@ -3,7 +3,7 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -from azure_devtools.scenario_tests import RecordingProcessor, mock_in_unit_test +from azure.cli.testsdk.scenario_tests import RecordingProcessor, mock_in_unit_test MOCK_JOB_ID = '00000000-0000-0000-0000-000000000000' diff --git a/src/azure-cli/azure/cli/command_modules/dls/tests/latest/test_dls_commands.py b/src/azure-cli/azure/cli/command_modules/dls/tests/latest/test_dls_commands.py index 3238fc5da69..0f0419e74f3 100644 --- a/src/azure-cli/azure/cli/command_modules/dls/tests/latest/test_dls_commands.py +++ b/src/azure-cli/azure/cli/command_modules/dls/tests/latest/test_dls_commands.py @@ -11,7 +11,7 @@ from msrestazure.azure_exceptions import CloudError from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer, LiveScenarioTest, VirtualNetworkPreparer -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse from knack.util import CLIError diff --git a/src/azure-cli/azure/cli/command_modules/eventhubs/tests/latest/test_cluster_commands.py b/src/azure-cli/azure/cli/command_modules/eventhubs/tests/latest/test_cluster_commands.py index 346c1dc36cd..716c299f36a 100644 --- a/src/azure-cli/azure/cli/command_modules/eventhubs/tests/latest/test_cluster_commands.py +++ b/src/azure-cli/azure/cli/command_modules/eventhubs/tests/latest/test_cluster_commands.py @@ -15,7 +15,7 @@ class EHNamespaceCURDScenarioTest(ScenarioTest): - from azure_devtools.scenario_tests import AllowLargeResponse + from azure.cli.testsdk.scenario_tests import AllowLargeResponse @AllowLargeResponse() def test_eh_cluster(self): diff --git a/src/azure-cli/azure/cli/command_modules/eventhubs/tests/latest/test_eventhub_commands.py b/src/azure-cli/azure/cli/command_modules/eventhubs/tests/latest/test_eventhub_commands.py index 6fae8d45a9a..720585e7095 100644 --- a/src/azure-cli/azure/cli/command_modules/eventhubs/tests/latest/test_eventhub_commands.py +++ b/src/azure-cli/azure/cli/command_modules/eventhubs/tests/latest/test_eventhub_commands.py @@ -15,7 +15,7 @@ class EHNamespaceCURDScenarioTest(ScenarioTest): - from azure_devtools.scenario_tests import AllowLargeResponse + from azure.cli.testsdk.scenario_tests import AllowLargeResponse @AllowLargeResponse() @ResourceGroupPreparer(name_prefix='cli_test_eh_namespace') diff --git a/src/azure-cli/azure/cli/command_modules/eventhubs/tests/latest/test_eventhub_commands_namespace_byok_test.py b/src/azure-cli/azure/cli/command_modules/eventhubs/tests/latest/test_eventhub_commands_namespace_byok_test.py index 20cac75caad..ae9566171ee 100644 --- a/src/azure-cli/azure/cli/command_modules/eventhubs/tests/latest/test_eventhub_commands_namespace_byok_test.py +++ b/src/azure-cli/azure/cli/command_modules/eventhubs/tests/latest/test_eventhub_commands_namespace_byok_test.py @@ -15,7 +15,7 @@ class EHNamespaceBYOKCURDScenarioTest(ScenarioTest): - from azure_devtools.scenario_tests import AllowLargeResponse + from azure.cli.testsdk.scenario_tests import AllowLargeResponse @AllowLargeResponse() @ResourceGroupPreparer(name_prefix='cli_test_eh_namespace') diff --git a/src/azure-cli/azure/cli/command_modules/eventhubs/tests/latest/test_eventhub_commands_namespace_premium_test.py b/src/azure-cli/azure/cli/command_modules/eventhubs/tests/latest/test_eventhub_commands_namespace_premium_test.py index a191b3af377..ced3da237d3 100644 --- a/src/azure-cli/azure/cli/command_modules/eventhubs/tests/latest/test_eventhub_commands_namespace_premium_test.py +++ b/src/azure-cli/azure/cli/command_modules/eventhubs/tests/latest/test_eventhub_commands_namespace_premium_test.py @@ -15,7 +15,7 @@ class EHNamespaceBYOKCURDScenarioTest(ScenarioTest): - from azure_devtools.scenario_tests import AllowLargeResponse + from azure.cli.testsdk.scenario_tests import AllowLargeResponse @AllowLargeResponse() @ResourceGroupPreparer(name_prefix='cli_test_eh_namespace') diff --git a/src/azure-cli/azure/cli/command_modules/hdinsight/tests/latest/test_hdinsight_commands.py b/src/azure-cli/azure/cli/command_modules/hdinsight/tests/latest/test_hdinsight_commands.py index ea97c5f3600..037b391d4e6 100644 --- a/src/azure-cli/azure/cli/command_modules/hdinsight/tests/latest/test_hdinsight_commands.py +++ b/src/azure-cli/azure/cli/command_modules/hdinsight/tests/latest/test_hdinsight_commands.py @@ -7,7 +7,7 @@ import os from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer, StorageAccountPreparer -from azure_devtools.scenario_tests import record_only +from azure.cli.testsdk.scenario_tests import record_only TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) diff --git a/src/azure-cli/azure/cli/command_modules/iot/tests/hybrid_2019_03_01/test_iot_commands.py b/src/azure-cli/azure/cli/command_modules/iot/tests/hybrid_2019_03_01/test_iot_commands.py index de096bce2db..b7af8e19780 100644 --- a/src/azure-cli/azure/cli/command_modules/iot/tests/hybrid_2019_03_01/test_iot_commands.py +++ b/src/azure-cli/azure/cli/command_modules/iot/tests/hybrid_2019_03_01/test_iot_commands.py @@ -5,7 +5,7 @@ # pylint: disable=too-many-statements from azure.cli.testsdk import ResourceGroupPreparer, ScenarioTest, StorageAccountPreparer -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse class IoTHubTest(ScenarioTest): diff --git a/src/azure-cli/azure/cli/command_modules/iot/tests/hybrid_2020_09_01/recording_processors.py b/src/azure-cli/azure/cli/command_modules/iot/tests/hybrid_2020_09_01/recording_processors.py index 74abb653eca..e0f6e050d4b 100644 --- a/src/azure-cli/azure/cli/command_modules/iot/tests/hybrid_2020_09_01/recording_processors.py +++ b/src/azure-cli/azure/cli/command_modules/iot/tests/hybrid_2020_09_01/recording_processors.py @@ -3,8 +3,8 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -from azure_devtools.scenario_tests import RecordingProcessor -from azure_devtools.scenario_tests.utilities import is_text_payload +from azure.cli.testsdk.scenario_tests import RecordingProcessor +from azure.cli.testsdk.scenario_tests.utilities import is_text_payload MOCK_KEY = 'mock_key' diff --git a/src/azure-cli/azure/cli/command_modules/iot/tests/hybrid_2020_09_01/test_iot_commands.py b/src/azure-cli/azure/cli/command_modules/iot/tests/hybrid_2020_09_01/test_iot_commands.py index aa4f8727511..b898712236b 100644 --- a/src/azure-cli/azure/cli/command_modules/iot/tests/hybrid_2020_09_01/test_iot_commands.py +++ b/src/azure-cli/azure/cli/command_modules/iot/tests/hybrid_2020_09_01/test_iot_commands.py @@ -5,7 +5,7 @@ # pylint: disable=too-many-statements from azure.cli.testsdk import ResourceGroupPreparer, ScenarioTest, StorageAccountPreparer -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse from .recording_processors import KeyReplacer import unittest diff --git a/src/azure-cli/azure/cli/command_modules/iot/tests/latest/recording_processors.py b/src/azure-cli/azure/cli/command_modules/iot/tests/latest/recording_processors.py index 74abb653eca..e0f6e050d4b 100644 --- a/src/azure-cli/azure/cli/command_modules/iot/tests/latest/recording_processors.py +++ b/src/azure-cli/azure/cli/command_modules/iot/tests/latest/recording_processors.py @@ -3,8 +3,8 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -from azure_devtools.scenario_tests import RecordingProcessor -from azure_devtools.scenario_tests.utilities import is_text_payload +from azure.cli.testsdk.scenario_tests import RecordingProcessor +from azure.cli.testsdk.scenario_tests.utilities import is_text_payload MOCK_KEY = 'mock_key' diff --git a/src/azure-cli/azure/cli/command_modules/iot/tests/latest/test_iot_commands.py b/src/azure-cli/azure/cli/command_modules/iot/tests/latest/test_iot_commands.py index 558b50f26b2..37d11c00e73 100644 --- a/src/azure-cli/azure/cli/command_modules/iot/tests/latest/test_iot_commands.py +++ b/src/azure-cli/azure/cli/command_modules/iot/tests/latest/test_iot_commands.py @@ -7,7 +7,7 @@ from unittest import mock from azure.cli.testsdk import ResourceGroupPreparer, ScenarioTest, StorageAccountPreparer -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse from azure.mgmt.iothub.models import RoutingSource from azure.cli.command_modules.iot.shared import IdentityType from .recording_processors import KeyReplacer diff --git a/src/azure-cli/azure/cli/command_modules/keyvault/tests/latest/test_keyvault_commands.py b/src/azure-cli/azure/cli/command_modules/keyvault/tests/latest/test_keyvault_commands.py index 7bd0c7ff869..2b087a7d032 100644 --- a/src/azure-cli/azure/cli/command_modules/keyvault/tests/latest/test_keyvault_commands.py +++ b/src/azure-cli/azure/cli/command_modules/keyvault/tests/latest/test_keyvault_commands.py @@ -13,8 +13,8 @@ from dateutil import tz from ipaddress import ip_network -from azure_devtools.scenario_tests import AllowLargeResponse, record_only -from azure_devtools.scenario_tests import RecordingProcessor +from azure.cli.testsdk.scenario_tests import AllowLargeResponse, record_only +from azure.cli.testsdk.scenario_tests import RecordingProcessor from azure.cli.testsdk import ResourceGroupPreparer, KeyVaultPreparer, ScenarioTest from knack.util import CLIError diff --git a/src/azure-cli/azure/cli/command_modules/monitor/tests/latest/test_activity_log_scenario.py b/src/azure-cli/azure/cli/command_modules/monitor/tests/latest/test_activity_log_scenario.py index a240681746f..2ba9fd98efe 100644 --- a/src/azure-cli/azure/cli/command_modules/monitor/tests/latest/test_activity_log_scenario.py +++ b/src/azure-cli/azure/cli/command_modules/monitor/tests/latest/test_activity_log_scenario.py @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer, StorageAccountPreparer -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse # This is a live test because the start and end time can't be determined dynamically diff --git a/src/azure-cli/azure/cli/command_modules/monitor/tests/latest/test_monitor_autoscale.py b/src/azure-cli/azure/cli/command_modules/monitor/tests/latest/test_monitor_autoscale.py index 174e4b3101a..c8eab8c0d51 100644 --- a/src/azure-cli/azure/cli/command_modules/monitor/tests/latest/test_monitor_autoscale.py +++ b/src/azure-cli/azure/cli/command_modules/monitor/tests/latest/test_monitor_autoscale.py @@ -5,7 +5,7 @@ from azure.cli.testsdk import LiveScenarioTest, ScenarioTest, ResourceGroupPreparer, record_only from knack.util import CLIError -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse class TestMonitorAutoscaleScenario(ScenarioTest): diff --git a/src/azure-cli/azure/cli/command_modules/monitor/tests/latest/test_monitor_log_analytics_workspace.py b/src/azure-cli/azure/cli/command_modules/monitor/tests/latest/test_monitor_log_analytics_workspace.py index 851ef124acc..8bcf8fb708f 100644 --- a/src/azure-cli/azure/cli/command_modules/monitor/tests/latest/test_monitor_log_analytics_workspace.py +++ b/src/azure-cli/azure/cli/command_modules/monitor/tests/latest/test_monitor_log_analytics_workspace.py @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer, record_only, StorageAccountPreparer -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse class TestLogProfileScenarios(ScenarioTest): diff --git a/src/azure-cli/azure/cli/command_modules/monitor/tests/latest/test_monitor_metric_alert_scenarios.py b/src/azure-cli/azure/cli/command_modules/monitor/tests/latest/test_monitor_metric_alert_scenarios.py index b24239f6fe2..c12f34258a2 100644 --- a/src/azure-cli/azure/cli/command_modules/monitor/tests/latest/test_monitor_metric_alert_scenarios.py +++ b/src/azure-cli/azure/cli/command_modules/monitor/tests/latest/test_monitor_metric_alert_scenarios.py @@ -6,7 +6,7 @@ import unittest from azure.cli.testsdk import ScenarioTest, JMESPathCheck, ResourceGroupPreparer, StorageAccountPreparer, record_only from azure.cli.command_modules.backup.tests.latest.preparers import VMPreparer -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse from azure.cli.command_modules.sql.tests.latest.test_sql_commands import SqlServerPreparer diff --git a/src/azure-cli/azure/cli/command_modules/network/tests/hybrid_2018_03_01/test_network_commands.py b/src/azure-cli/azure/cli/command_modules/network/tests/hybrid_2018_03_01/test_network_commands.py index b3a849fdc98..2ac424d9680 100644 --- a/src/azure-cli/azure/cli/command_modules/network/tests/hybrid_2018_03_01/test_network_commands.py +++ b/src/azure-cli/azure/cli/command_modules/network/tests/hybrid_2018_03_01/test_network_commands.py @@ -8,7 +8,7 @@ import os import unittest -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse from azure.cli.core.commands.client_factory import get_subscription_id from azure.cli.core.profiles import supported_api_version, ResourceType diff --git a/src/azure-cli/azure/cli/command_modules/network/tests/latest/credential_replacer.py b/src/azure-cli/azure/cli/command_modules/network/tests/latest/credential_replacer.py index 22ae0e964ac..51fc75aaceb 100644 --- a/src/azure-cli/azure/cli/command_modules/network/tests/latest/credential_replacer.py +++ b/src/azure-cli/azure/cli/command_modules/network/tests/latest/credential_replacer.py @@ -5,7 +5,7 @@ # pylint: disable=line-too-long -from azure_devtools.scenario_tests import RecordingProcessor +from azure.cli.testsdk.scenario_tests import RecordingProcessor class ExpressRoutePortLOAContentReplacer(RecordingProcessor): diff --git a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recording_processors.py b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recording_processors.py index ea751171ea7..ef5bad90564 100644 --- a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recording_processors.py +++ b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recording_processors.py @@ -2,7 +2,7 @@ # 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 +from azure.cli.testsdk.scenario_tests import RecordingProcessor def byte_to_str(byte_or_str): diff --git a/src/azure-cli/azure/cli/command_modules/network/tests/latest/test_network_commands.py b/src/azure-cli/azure/cli/command_modules/network/tests/latest/test_network_commands.py index a90b3f5a10a..edc78b9135c 100644 --- a/src/azure-cli/azure/cli/command_modules/network/tests/latest/test_network_commands.py +++ b/src/azure-cli/azure/cli/command_modules/network/tests/latest/test_network_commands.py @@ -9,7 +9,7 @@ import unittest import tempfile -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse from azure.cli.core.commands.client_factory import get_subscription_id from azure.cli.core.profiles import supported_api_version, ResourceType from azure.core.exceptions import HttpResponseError diff --git a/src/azure-cli/azure/cli/command_modules/network/tests/latest/test_nw_connection_monitor.py b/src/azure-cli/azure/cli/command_modules/network/tests/latest/test_nw_connection_monitor.py index 31a8f6f4f9c..c327cd36ec1 100644 --- a/src/azure-cli/azure/cli/command_modules/network/tests/latest/test_nw_connection_monitor.py +++ b/src/azure-cli/azure/cli/command_modules/network/tests/latest/test_nw_connection_monitor.py @@ -6,7 +6,7 @@ from knack.util import CLIError -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer) diff --git a/src/azure-cli/azure/cli/command_modules/network/tests/latest/test_private_endpoint_commands.py b/src/azure-cli/azure/cli/command_modules/network/tests/latest/test_private_endpoint_commands.py index bbed9b7a65b..0b214e6a5b5 100644 --- a/src/azure-cli/azure/cli/command_modules/network/tests/latest/test_private_endpoint_commands.py +++ b/src/azure-cli/azure/cli/command_modules/network/tests/latest/test_private_endpoint_commands.py @@ -14,7 +14,7 @@ from azure.cli.command_modules.rdbms.tests.latest.test_rdbms_commands import ServerPreparer from azure.cli.command_modules.batch.tests.latest.batch_preparers import BatchAccountPreparer, BatchScenarioMixin -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) diff --git a/src/azure-cli/azure/cli/command_modules/policyinsights/tests/latest/test_policyinsights_scenario.py b/src/azure-cli/azure/cli/command_modules/policyinsights/tests/latest/test_policyinsights_scenario.py index a1cdcf87ea9..976dc52d102 100644 --- a/src/azure-cli/azure/cli/command_modules/policyinsights/tests/latest/test_policyinsights_scenario.py +++ b/src/azure-cli/azure/cli/command_modules/policyinsights/tests/latest/test_policyinsights_scenario.py @@ -5,7 +5,7 @@ import time -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer, StorageAccountPreparer, create_random_name, record_only from azure.cli.testsdk.exceptions import JMESPathCheckAssertionError diff --git a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/test_rdbms_commands.py b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/test_rdbms_commands.py index 13b2c8d24ac..99bafb55cc5 100644 --- a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/test_rdbms_commands.py +++ b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/test_rdbms_commands.py @@ -7,7 +7,7 @@ from datetime import datetime from time import sleep from dateutil.tz import tzutc # pylint: disable=import-error -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse from msrestazure.azure_exceptions import CloudError from azure.core.exceptions import HttpResponseError from azure.cli.core.util import CLIError diff --git a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py index 1a03087599d..30bdd03faac 100644 --- a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py +++ b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py @@ -7,7 +7,7 @@ from datetime import datetime, timedelta, tzinfo from time import sleep from dateutil.tz import tzutc -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse from msrestazure.azure_exceptions import CloudError from azure.cli.core.local_context import AzCLILocalContext, ALL, LOCAL_CONTEXT_FILE from azure.cli.core.util import CLIError diff --git a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands_local_context.py b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands_local_context.py index a5007cc8723..d397be4050a 100644 --- a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands_local_context.py +++ b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands_local_context.py @@ -2,7 +2,7 @@ # 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 AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse from azure.cli.core.local_context import AzCLILocalContext, ALL, LOCAL_CONTEXT_FILE from azure.cli.core.util import CLIError from azure.cli.testsdk import ( diff --git a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands_postgres_migration.py b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands_postgres_migration.py index a933444bbd4..2e825f32780 100644 --- a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands_postgres_migration.py +++ b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands_postgres_migration.py @@ -13,7 +13,7 @@ from datetime import datetime from time import sleep from dateutil.tz import tzutc # pylint: disable=import-error -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse from msrestazure.azure_exceptions import CloudError from azure.cli.core.util import CLIError from azure.cli.core.util import parse_proxy_resource_id @@ -57,11 +57,11 @@ def _test_server_migration(self, database_engine): target_server_name = "raganesa-t-m-pg-1-vnet" curr_dir = os.path.dirname(os.path.realpath(__file__)) properties_filepath = os.path.join(curr_dir, 'migrationVNet.json').replace('\\', '\\\\') - + # test check migration name availability -success result = self.cmd('{} flexible-server migration check-name-availability --subscription {} --resource-group {} --name {} --migration-name {} ' .format(database_engine, target_subscription_id, target_resource_group_name, target_server_name, migration_name)).get_output_in_json() - + # test create migration - success result = self.cmd('{} flexible-server migration create --subscription {} --resource-group {} --name {} --migration-name {} --properties {} ' .format(database_engine, target_subscription_id, target_resource_group_name, target_server_name, migration_name, properties_filepath)).get_output_in_json() diff --git a/src/azure-cli/azure/cli/command_modules/resource/tests/hybrid_2018_03_01/test_resource.py b/src/azure-cli/azure/cli/command_modules/resource/tests/hybrid_2018_03_01/test_resource.py index 0f2e16ac09c..f4be2596b7e 100644 --- a/src/azure-cli/azure/cli/command_modules/resource/tests/hybrid_2018_03_01/test_resource.py +++ b/src/azure-cli/azure/cli/command_modules/resource/tests/hybrid_2018_03_01/test_resource.py @@ -8,7 +8,7 @@ import time import unittest -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse from azure.cli.testsdk import ScenarioTest, LiveScenarioTest, ResourceGroupPreparer, create_random_name, live_only from azure.cli.core.util import get_file_json diff --git a/src/azure-cli/azure/cli/command_modules/resource/tests/hybrid_2019_03_01/test_resource.py b/src/azure-cli/azure/cli/command_modules/resource/tests/hybrid_2019_03_01/test_resource.py index 1e315ec9ce6..22943d46181 100644 --- a/src/azure-cli/azure/cli/command_modules/resource/tests/hybrid_2019_03_01/test_resource.py +++ b/src/azure-cli/azure/cli/command_modules/resource/tests/hybrid_2019_03_01/test_resource.py @@ -9,8 +9,8 @@ from unittest import mock import unittest -from azure_devtools.scenario_tests.const import MOCKED_SUBSCRIPTION_ID -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests.const import MOCKED_SUBSCRIPTION_ID +from azure.cli.testsdk.scenario_tests import AllowLargeResponse from azure.cli.testsdk import ScenarioTest, LiveScenarioTest, ResourceGroupPreparer, create_random_name, live_only, record_only from azure.cli.core.util import get_file_json diff --git a/src/azure-cli/azure/cli/command_modules/resource/tests/latest/test_resource.py b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/test_resource.py index 394345e8cea..51878ad2206 100644 --- a/src/azure-cli/azure/cli/command_modules/resource/tests/latest/test_resource.py +++ b/src/azure-cli/azure/cli/command_modules/resource/tests/latest/test_resource.py @@ -13,8 +13,8 @@ from pathlib import Path from azure.cli.core.parser import IncorrectUsageError, InvalidArgumentValueError -from azure_devtools.scenario_tests.const import MOCKED_SUBSCRIPTION_ID -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests.const import MOCKED_SUBSCRIPTION_ID +from azure.cli.testsdk.scenario_tests import AllowLargeResponse from azure.cli.testsdk import (ScenarioTest, LocalContextScenarioTest, LiveScenarioTest, ResourceGroupPreparer, StorageAccountPreparer, create_random_name, live_only, record_only) from azure.cli.testsdk.constants import AUX_SUBSCRIPTION, AUX_TENANT diff --git a/src/azure-cli/azure/cli/command_modules/role/tests/hybrid_2018_03_01/test_role.py b/src/azure-cli/azure/cli/command_modules/role/tests/hybrid_2018_03_01/test_role.py index 3028fefb67c..1c01abedfb4 100644 --- a/src/azure-cli/azure/cli/command_modules/role/tests/hybrid_2018_03_01/test_role.py +++ b/src/azure-cli/azure/cli/command_modules/role/tests/hybrid_2018_03_01/test_role.py @@ -12,7 +12,7 @@ from unittest import mock import unittest -from azure_devtools.scenario_tests import AllowLargeResponse, record_only +from azure.cli.testsdk.scenario_tests import AllowLargeResponse, record_only from azure.cli.core.profiles import ResourceType, get_sdk from azure.cli.testsdk import ScenarioTest, LiveScenarioTest, ResourceGroupPreparer, KeyVaultPreparer from ..util import retry diff --git a/src/azure-cli/azure/cli/command_modules/role/tests/latest/test_graph.py b/src/azure-cli/azure/cli/command_modules/role/tests/latest/test_graph.py index 2d8c8c4ec85..ceb271b3d12 100644 --- a/src/azure-cli/azure/cli/command_modules/role/tests/latest/test_graph.py +++ b/src/azure-cli/azure/cli/command_modules/role/tests/latest/test_graph.py @@ -8,7 +8,7 @@ import datetime import dateutil import dateutil.parser -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse from azure.cli.testsdk import ScenarioTest, AADGraphUserReplacer, MOCKED_USER_NAME from knack.util import CLIError diff --git a/src/azure-cli/azure/cli/command_modules/role/tests/latest/test_role.py b/src/azure-cli/azure/cli/command_modules/role/tests/latest/test_role.py index 3f587660a55..42c10460b71 100644 --- a/src/azure-cli/azure/cli/command_modules/role/tests/latest/test_role.py +++ b/src/azure-cli/azure/cli/command_modules/role/tests/latest/test_role.py @@ -13,7 +13,7 @@ import unittest from knack.util import CLIError -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse from azure.cli.core.profiles import ResourceType, get_sdk from azure.cli.testsdk import ScenarioTest, LiveScenarioTest, ResourceGroupPreparer, KeyVaultPreparer from ..util import retry diff --git a/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_adaptive_application_controls.py b/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_adaptive_application_controls.py index 0f7ed30a16f..a85f67519b4 100644 --- a/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_adaptive_application_controls.py +++ b/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_adaptive_application_controls.py @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- from azure.cli.testsdk import ScenarioTest, record_only -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse class SecurityCenterAdaptiveadaptiveApplicationControlsTests(ScenarioTest): diff --git a/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_adaptive_network_hardenings_scenario.py b/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_adaptive_network_hardenings_scenario.py index fb5a1e0fab3..bd3efd9f04e 100644 --- a/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_adaptive_network_hardenings_scenario.py +++ b/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_adaptive_network_hardenings_scenario.py @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- from azure.cli.testsdk import ScenarioTest, record_only -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse class SecurityCenterAdaptiveNetworkHardeningsTests(ScenarioTest): diff --git a/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_alerts_scenario.py b/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_alerts_scenario.py index b7fcf4d227f..f6797e02a19 100644 --- a/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_alerts_scenario.py +++ b/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_alerts_scenario.py @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- from azure.cli.testsdk import ScenarioTest, record_only -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse import re diff --git a/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_allowed_connections_scenario.py b/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_allowed_connections_scenario.py index 9f19071c50e..cb9284b7dc5 100644 --- a/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_allowed_connections_scenario.py +++ b/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_allowed_connections_scenario.py @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- from azure.cli.testsdk import ScenarioTest -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse class SecurityCenterAllowedConnectionsTests(ScenarioTest): diff --git a/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_assessments_scenario.py b/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_assessments_scenario.py index 410811131e4..f84e469a523 100644 --- a/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_assessments_scenario.py +++ b/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_assessments_scenario.py @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- from azure.cli.testsdk import ScenarioTest -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse class SecurityCenterAssessmentsTests(ScenarioTest): diff --git a/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_auto_provisioning_settings_scenario.py b/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_auto_provisioning_settings_scenario.py index 0a342a7ec64..d547f32f54d 100644 --- a/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_auto_provisioning_settings_scenario.py +++ b/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_auto_provisioning_settings_scenario.py @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- from azure.cli.testsdk import ScenarioTest -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse class SecurityCenterAutoProvisioningSettingsTests(ScenarioTest): diff --git a/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_discovered_security_solutions_scenario.py b/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_discovered_security_solutions_scenario.py index a3c87d3a034..25e112dcfeb 100644 --- a/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_discovered_security_solutions_scenario.py +++ b/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_discovered_security_solutions_scenario.py @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- from azure.cli.testsdk import ScenarioTest -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse class SecurityCenterDiscoveredSecuritySoluytionsTests(ScenarioTest): diff --git a/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_external_security_solutions_scenario.py b/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_external_security_solutions_scenario.py index 854271a2319..a12131fcb27 100644 --- a/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_external_security_solutions_scenario.py +++ b/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_external_security_solutions_scenario.py @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- from azure.cli.testsdk import ScenarioTest -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse class SecurityCenterExternalSecuritySoluytionsTests(ScenarioTest): diff --git a/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_iot_scenario.py b/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_iot_scenario.py index af7c2de04f4..2e3974f9100 100644 --- a/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_iot_scenario.py +++ b/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_iot_scenario.py @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse class SecurityCenterIotTests(ScenarioTest): diff --git a/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_jit_scenario.py b/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_jit_scenario.py index 2e173230eeb..ada212f6f66 100644 --- a/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_jit_scenario.py +++ b/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_jit_scenario.py @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- from azure.cli.testsdk import ScenarioTest -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse class SecurityCenterJitPolicyTests(ScenarioTest): diff --git a/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_locations_scenario.py b/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_locations_scenario.py index 605342df8f1..9c9cb468ca2 100644 --- a/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_locations_scenario.py +++ b/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_locations_scenario.py @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- from azure.cli.testsdk import ScenarioTest -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse class SecurityCenterLocationsTests(ScenarioTest): diff --git a/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_pricings_scenario.py b/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_pricings_scenario.py index d42771336b6..295010c6ac0 100644 --- a/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_pricings_scenario.py +++ b/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_pricings_scenario.py @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- from azure.cli.testsdk import ScenarioTest -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse class SecurityCenterPricingsTests(ScenarioTest): diff --git a/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_regulatory_compliance_scenario.py b/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_regulatory_compliance_scenario.py index 14a01923b15..adb7ef5a872 100644 --- a/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_regulatory_compliance_scenario.py +++ b/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_regulatory_compliance_scenario.py @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- from azure.cli.testsdk import ScenarioTest -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse class SecurityCenterRegulatoryComplianceTests(ScenarioTest): diff --git a/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_secure_score_scenario.py b/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_secure_score_scenario.py index 64e86421ff5..625c556814a 100644 --- a/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_secure_score_scenario.py +++ b/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_secure_score_scenario.py @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- from azure.cli.testsdk import ScenarioTest -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse class SecurityCenteSecureScoreTests(ScenarioTest): diff --git a/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_security_contacts_scenario.py b/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_security_contacts_scenario.py index df234bc7b49..812a76ffd78 100644 --- a/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_security_contacts_scenario.py +++ b/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_security_contacts_scenario.py @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- from azure.cli.testsdk import ScenarioTest -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse class SecurityCenterSecurityContactsTests(ScenarioTest): diff --git a/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_settings_scenario.py b/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_settings_scenario.py index 56cab96b90b..14bea70d876 100644 --- a/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_settings_scenario.py +++ b/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_settings_scenario.py @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- from azure.cli.testsdk import ScenarioTest -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse class SecurityCenterSettingsTests(ScenarioTest): @@ -23,4 +23,3 @@ def test_security_settings_update(self): setting = self.cmd('az security setting update -n Sentinel --enabled false' ).get_output_in_json() assert setting['enabled'] == False - diff --git a/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_tasks_scenario.py b/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_tasks_scenario.py index 0afe07e376c..6286e79fb7d 100644 --- a/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_tasks_scenario.py +++ b/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_tasks_scenario.py @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- from azure.cli.testsdk import ScenarioTest -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse from msrestazure.tools import parse_resource_id import re diff --git a/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_topologies_scenario.py b/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_topologies_scenario.py index be5f2c252f5..07e4699e356 100644 --- a/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_topologies_scenario.py +++ b/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_topologies_scenario.py @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- from azure.cli.testsdk import ScenarioTest -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse import re diff --git a/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_workspace_settings_scenario.py b/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_workspace_settings_scenario.py index fb6281648d6..a6279ef3192 100644 --- a/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_workspace_settings_scenario.py +++ b/src/azure-cli/azure/cli/command_modules/security/tests/latest/test_workspace_settings_scenario.py @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse import os import unittest diff --git a/src/azure-cli/azure/cli/command_modules/servicebus/tests/latest/test_servicebus_alias_commands.py b/src/azure-cli/azure/cli/command_modules/servicebus/tests/latest/test_servicebus_alias_commands.py index 48ab9eac3b7..d158117a4a9 100644 --- a/src/azure-cli/azure/cli/command_modules/servicebus/tests/latest/test_servicebus_alias_commands.py +++ b/src/azure-cli/azure/cli/command_modules/servicebus/tests/latest/test_servicebus_alias_commands.py @@ -15,7 +15,7 @@ class SBDRAliasCRUDScenarioTest(ScenarioTest): - from azure_devtools.scenario_tests import AllowLargeResponse + from azure.cli.testsdk.scenario_tests import AllowLargeResponse @AllowLargeResponse() @ResourceGroupPreparer(name_prefix='cli_test_sb_alias') diff --git a/src/azure-cli/azure/cli/command_modules/servicebus/tests/latest/test_servicebus_migration_commands.py b/src/azure-cli/azure/cli/command_modules/servicebus/tests/latest/test_servicebus_migration_commands.py index afa53731b14..a3ddc2b106d 100644 --- a/src/azure-cli/azure/cli/command_modules/servicebus/tests/latest/test_servicebus_migration_commands.py +++ b/src/azure-cli/azure/cli/command_modules/servicebus/tests/latest/test_servicebus_migration_commands.py @@ -15,7 +15,7 @@ class SBNSMigrationCRUDScenarioTest(ScenarioTest): - from azure_devtools.scenario_tests import AllowLargeResponse + from azure.cli.testsdk.scenario_tests import AllowLargeResponse # Test playback fails and the live-only flag will be removed once it is addressed @live_only() diff --git a/src/azure-cli/azure/cli/command_modules/servicebus/tests/latest/test_servicebus_namespace_commands.py b/src/azure-cli/azure/cli/command_modules/servicebus/tests/latest/test_servicebus_namespace_commands.py index 3a52eb5ce54..e4f97b5f17d 100644 --- a/src/azure-cli/azure/cli/command_modules/servicebus/tests/latest/test_servicebus_namespace_commands.py +++ b/src/azure-cli/azure/cli/command_modules/servicebus/tests/latest/test_servicebus_namespace_commands.py @@ -15,7 +15,7 @@ class SBNamespaceCRUDScenarioTest(ScenarioTest): - from azure_devtools.scenario_tests import AllowLargeResponse + from azure.cli.testsdk.scenario_tests import AllowLargeResponse @AllowLargeResponse() @ResourceGroupPreparer(name_prefix='cli_test_sb_namespace') diff --git a/src/azure-cli/azure/cli/command_modules/servicebus/tests/latest/test_servicebus_network_commands.py b/src/azure-cli/azure/cli/command_modules/servicebus/tests/latest/test_servicebus_network_commands.py index f83e53fa869..bcf6e5c97fd 100644 --- a/src/azure-cli/azure/cli/command_modules/servicebus/tests/latest/test_servicebus_network_commands.py +++ b/src/azure-cli/azure/cli/command_modules/servicebus/tests/latest/test_servicebus_network_commands.py @@ -15,7 +15,7 @@ class SBNetworkrulesetCRUDScenarioTest(ScenarioTest): - from azure_devtools.scenario_tests import AllowLargeResponse + from azure.cli.testsdk.scenario_tests import AllowLargeResponse @AllowLargeResponse() @ResourceGroupPreparer(name_prefix='cli_test_sb_network') diff --git a/src/azure-cli/azure/cli/command_modules/servicebus/tests/latest/test_servicebus_queue_commands.py b/src/azure-cli/azure/cli/command_modules/servicebus/tests/latest/test_servicebus_queue_commands.py index ff1f1a4ec4f..85e87e73f52 100644 --- a/src/azure-cli/azure/cli/command_modules/servicebus/tests/latest/test_servicebus_queue_commands.py +++ b/src/azure-cli/azure/cli/command_modules/servicebus/tests/latest/test_servicebus_queue_commands.py @@ -15,7 +15,7 @@ class SBQueueScenarioTest(ScenarioTest): - from azure_devtools.scenario_tests import AllowLargeResponse + from azure.cli.testsdk.scenario_tests import AllowLargeResponse @AllowLargeResponse() @ResourceGroupPreparer(name_prefix='cli_test_sb_queue') diff --git a/src/azure-cli/azure/cli/command_modules/servicebus/tests/latest/test_servicebus_rules_commands.py b/src/azure-cli/azure/cli/command_modules/servicebus/tests/latest/test_servicebus_rules_commands.py index 58932c6d3d9..e53f552143f 100644 --- a/src/azure-cli/azure/cli/command_modules/servicebus/tests/latest/test_servicebus_rules_commands.py +++ b/src/azure-cli/azure/cli/command_modules/servicebus/tests/latest/test_servicebus_rules_commands.py @@ -15,7 +15,7 @@ class SBRulesCRUDScenarioTest(ScenarioTest): - from azure_devtools.scenario_tests import AllowLargeResponse + from azure.cli.testsdk.scenario_tests import AllowLargeResponse @AllowLargeResponse() @ResourceGroupPreparer(name_prefix='cli_test_sb_rules') diff --git a/src/azure-cli/azure/cli/command_modules/servicebus/tests/latest/test_servicebus_subscription_commands.py b/src/azure-cli/azure/cli/command_modules/servicebus/tests/latest/test_servicebus_subscription_commands.py index 1318bfc0e9f..c5d371f0ac2 100644 --- a/src/azure-cli/azure/cli/command_modules/servicebus/tests/latest/test_servicebus_subscription_commands.py +++ b/src/azure-cli/azure/cli/command_modules/servicebus/tests/latest/test_servicebus_subscription_commands.py @@ -15,7 +15,7 @@ class SBSubscriptionCRUDScenarioTest(ScenarioTest): - from azure_devtools.scenario_tests import AllowLargeResponse + from azure.cli.testsdk.scenario_tests import AllowLargeResponse @AllowLargeResponse() @ResourceGroupPreparer(name_prefix='cli_test_sb_subscription') diff --git a/src/azure-cli/azure/cli/command_modules/servicebus/tests/latest/test_servicebus_topic_commands.py b/src/azure-cli/azure/cli/command_modules/servicebus/tests/latest/test_servicebus_topic_commands.py index 1854515ea7c..e9955d2c2e7 100644 --- a/src/azure-cli/azure/cli/command_modules/servicebus/tests/latest/test_servicebus_topic_commands.py +++ b/src/azure-cli/azure/cli/command_modules/servicebus/tests/latest/test_servicebus_topic_commands.py @@ -15,7 +15,7 @@ class SBTopicsCRUDScenarioTest(ScenarioTest): - from azure_devtools.scenario_tests import AllowLargeResponse + from azure.cli.testsdk.scenario_tests import AllowLargeResponse @AllowLargeResponse() @ResourceGroupPreparer(name_prefix='cli_test_sb_topic') diff --git a/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_springcloud_connection_scenario.py b/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_springcloud_connection_scenario.py index b1dd6766434..c4f629a0c7a 100644 --- a/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_springcloud_connection_scenario.py +++ b/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_springcloud_connection_scenario.py @@ -11,8 +11,8 @@ ScenarioTest, record_only ) -from azure_devtools.scenario_tests import RecordingProcessor -from azure_devtools.scenario_tests.utilities import is_text_payload +from azure.cli.testsdk.scenario_tests import RecordingProcessor +from azure.cli.testsdk.scenario_tests.utilities import is_text_payload from azure.cli.command_modules.serviceconnector._resource_config import ( RESOURCE, SOURCE_RESOURCES, diff --git a/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_springcloud_connection_scenario_withoutId.py b/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_springcloud_connection_scenario_withoutId.py index fe6f4adbc53..6a49b38a009 100644 --- a/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_springcloud_connection_scenario_withoutId.py +++ b/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_springcloud_connection_scenario_withoutId.py @@ -11,8 +11,8 @@ ScenarioTest, record_only ) -from azure_devtools.scenario_tests import RecordingProcessor -from azure_devtools.scenario_tests.utilities import is_text_payload +from azure.cli.testsdk.scenario_tests import RecordingProcessor +from azure.cli.testsdk.scenario_tests.utilities import is_text_payload from azure.cli.command_modules.serviceconnector._resource_config import ( RESOURCE, SOURCE_RESOURCES, @@ -51,7 +51,7 @@ def process_request(self, request): # hide token in header if 'x-ms-cupertino-test-token' in request.headers: request.headers['x-ms-cupertino-test-token'] = 'hidden' - + return request def process_response(self, response): @@ -93,7 +93,7 @@ def test_springcloud_appconfig_e2e(self): # create connection self.cmd('spring-cloud connection create appconfig --connection {name} -g {source_resource_group} --service {spring} --app {app} ' '--tg {target_resource_group} --app-config {config_store} --system-identity --client-type java') - + # list connection connections = self.cmd( 'spring-cloud connection list -g {source_resource_group} --service {spring} --app {app} ', @@ -136,7 +136,7 @@ def test_springcloud_cosmoscassandra_e2e(self): # create connection self.cmd('spring-cloud connection create cosmos-cassandra --connection {name} -g {source_resource_group} --service {spring} --app {app} ' '--tg {target_resource_group} --account {account} --key-space {key_space} --system-identity --client-type java') - + # list connection connections = self.cmd( 'spring-cloud connection list -g {source_resource_group} --service {spring} --app {app}', @@ -180,7 +180,7 @@ def test_springcloud_cosmosgremlin_e2e(self): # create connection self.cmd('spring-cloud connection create cosmos-gremlin --connection {name} -g {source_resource_group} --service {spring} --app {app} ' '--tg {target_resource_group} --account {account} --database {database} --graph {graph} --system-identity --client-type java') - + # list connection connections = self.cmd( 'spring-cloud connection list -g {source_resource_group} --service {spring} --app {app}', @@ -223,7 +223,7 @@ def test_springcloud_cosmosmongo_e2e(self): # create connection self.cmd('spring-cloud connection create cosmos-mongo --connection {name} -g {source_resource_group} --service {spring} --app {app} ' '--tg {target_resource_group} --account {account} --database {database} --system-identity --client-type java') - + # list connection connections = self.cmd( 'spring-cloud connection list -g {source_resource_group} --service {spring} --app {app}', @@ -266,7 +266,7 @@ def test_springcloud_cosmossql_e2e(self): # create connection self.cmd('spring-cloud connection create cosmos-sql --connection {name} -g {source_resource_group} --service {spring} --app {app} ' '--tg {target_resource_group} --account {account} --database {database} --system-identity --client-type java') - + # list connection connections = self.cmd( 'spring-cloud connection list -g {source_resource_group} --service {spring} --app {app}', @@ -309,7 +309,7 @@ def test_springcloud_cosmostable_e2e(self): # create connection self.cmd('spring-cloud connection create cosmos-table --connection {name} -g {source_resource_group} --service {spring} --app {app} ' '--tg {target_resource_group} --account {account} --table {table} --system-identity --client-type java') - + # list connection connections = self.cmd( 'spring-cloud connection list -g {source_resource_group} --service {spring} --app {app}', @@ -344,14 +344,14 @@ def test_springcloud_eventhub_e2e(self): 'spring': 'servicelinker-springcloud', 'app': 'eventhub', 'deployment': 'default', - 'namespace': 'servicelinkertesteventhub' + 'namespace': 'servicelinkertesteventhub' }) # create connection self.cmd('spring-cloud connection create eventhub --connection {name} -g {source_resource_group} --service {spring} --app {app} ' '--tg {target_resource_group} --namespace {namespace} --system-identity --client-type java') - + # list connection connections = self.cmd( 'spring-cloud connection list -g {source_resource_group} --service {spring} --app {app}', @@ -394,14 +394,14 @@ def test_springcloud_postgresflexible_e2e(self): # prepare password password = self.cmd('keyvault secret show --vault-name cupertino-kv-test -n TestDbPassword')\ .get_output_in_json().get('value') - + self.kwargs.update({'password': password}) # create connection self.cmd('spring-cloud connection create postgres-flexible --connection {name} -g {source_resource_group} --service {spring} --app {app} ' '--tg {target_resource_group} --server {server} --database {database} --secret name={user} secret={password} --client-type java') - + # list connection connections = self.cmd( 'spring-cloud connection list -g {source_resource_group} --service {spring} --app {app}', @@ -443,7 +443,7 @@ def test_springcloud_keyvault_e2e(self): # create connection self.cmd('spring-cloud connection create keyvault --connection {name} -g {source_resource_group} --service {spring} --app {app} ' '--tg {target_resource_group} --vault {vault} --system-identity --client-type java') - + # list connection connections = self.cmd( 'spring-cloud connection list -g {source_resource_group} --service {spring} --app {app}', @@ -492,7 +492,7 @@ def test_springcloud_mysql_e2e(self): # create connection self.cmd('spring-cloud connection create mysql --connection {name} -g {source_resource_group} --service {spring} --app {app} ' '--tg {target_resource_group} --server {server} --database {database} --secret name={user} secret={password} --client-type java') - + # list connection connections = self.cmd( 'spring-cloud connection list -g {source_resource_group} --service {spring} --app {app}', @@ -544,7 +544,7 @@ def test_springcloud_mysqlflexible_e2e(self): # create connection self.cmd('spring-cloud connection create mysql-flexible --connection {name} -g {source_resource_group} --service {spring} --app {app} ' '--tg {target_resource_group} --server {server} --database {database} --secret name={user} secret={password} --client-type java') - + # list connection connections = self.cmd( 'spring-cloud connection list -g {source_resource_group} --service {spring} --app {app}', @@ -596,7 +596,7 @@ def test_springcloud_postgres_e2e(self): # create connection self.cmd('spring-cloud connection create postgres --connection {name} -g {source_resource_group} --service {spring} --app {app} ' '--tg {target_resource_group} --server {server} --database {database} --secret name={user} secret={password} --client-type java') - + # list connection connections = self.cmd( 'spring-cloud connection list -g {source_resource_group} --service {spring} --app {app}', @@ -647,7 +647,7 @@ def test_springcloud_sql_e2e(self): # create connection self.cmd('spring-cloud connection create sql --connection {name} -g {source_resource_group} --service {spring} --app {app} ' '--tg {target_resource_group} --server {server} --database {database} --secret name={user} secret={password} --client-type java') - + # list connection connections = self.cmd( 'spring-cloud connection list -g {source_resource_group} --service {spring} --app {app}', @@ -688,7 +688,7 @@ def test_springcloud_storageblob_e2e(self): # create connection self.cmd('spring-cloud connection create storage-blob --connection {name} -g {source_resource_group} --service {spring} --app {app} ' '--tg {target_resource_group} --account {account} --system-identity --client-type java') - + # list connection connections = self.cmd( 'spring-cloud connection list -g {source_resource_group} --service {spring} --app {app}', @@ -711,7 +711,7 @@ def test_springcloud_storageblob_e2e(self): # delete connection self.cmd('spring-cloud connection delete --connection {name} -g {source_resource_group} --service {spring} --app {app} --yes') - + # @record_only def test_springcloud_storagequeue_e2e(self): @@ -729,7 +729,7 @@ def test_springcloud_storagequeue_e2e(self): # create connection self.cmd('spring-cloud connection create storage-queue --connection {name} -g {source_resource_group} --service {spring} --app {app} ' '--tg {target_resource_group} --account {account} --secret --client-type java') - + # list connection connections = self.cmd( 'spring-cloud connection list -g {source_resource_group} --service {spring} --app {app}', diff --git a/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_webapp_addon_scenario.py b/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_webapp_addon_scenario.py index 6d875d9d8db..c9cd2452335 100644 --- a/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_webapp_addon_scenario.py +++ b/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_webapp_addon_scenario.py @@ -6,11 +6,11 @@ from unittest.signals import installHandler from azure.cli.core.commands.client_factory import get_subscription_id -from azure_devtools.scenario_tests import ( +from azure.cli.testsdk.scenario_tests import ( AllowLargeResponse, RecordingProcessor ) -from azure_devtools.scenario_tests.utilities import is_text_payload +from azure.cli.testsdk.scenario_tests.utilities import is_text_payload from azure.cli.testsdk import ( ScenarioTest, live_only diff --git a/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_webpp_connection_scenario.py b/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_webpp_connection_scenario.py index cc5b937d330..6cde1d12b0c 100644 --- a/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_webpp_connection_scenario.py +++ b/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_webpp_connection_scenario.py @@ -10,8 +10,8 @@ ScenarioTest, record_only ) -from azure_devtools.scenario_tests import RecordingProcessor -from azure_devtools.scenario_tests.utilities import is_text_payload +from azure.cli.testsdk.scenario_tests import RecordingProcessor +from azure.cli.testsdk.scenario_tests.utilities import is_text_payload from azure.cli.command_modules.serviceconnector._resource_config import ( RESOURCE, SOURCE_RESOURCES, diff --git a/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_webpp_connection_scenario_withoutId.py b/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_webpp_connection_scenario_withoutId.py index 998549eed82..2a820a26655 100644 --- a/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_webpp_connection_scenario_withoutId.py +++ b/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_webpp_connection_scenario_withoutId.py @@ -10,8 +10,8 @@ ScenarioTest, record_only ) -from azure_devtools.scenario_tests import RecordingProcessor -from azure_devtools.scenario_tests.utilities import is_text_payload +from azure.cli.testsdk.scenario_tests import RecordingProcessor +from azure.cli.testsdk.scenario_tests.utilities import is_text_payload from azure.cli.command_modules.serviceconnector._resource_config import ( RESOURCE, SOURCE_RESOURCES, diff --git a/src/azure-cli/azure/cli/command_modules/sql/tests/latest/test_sql_commands.py b/src/azure-cli/azure/cli/command_modules/sql/tests/latest/test_sql_commands.py index e2943a605f9..262a2b57f71 100644 --- a/src/azure-cli/azure/cli/command_modules/sql/tests/latest/test_sql_commands.py +++ b/src/azure-cli/azure/cli/command_modules/sql/tests/latest/test_sql_commands.py @@ -6,7 +6,7 @@ import time import os -from azure_devtools.scenario_tests import AllowLargeResponse, live_only +from azure.cli.testsdk.scenario_tests import AllowLargeResponse, live_only from azure.cli.core.util import CLIError from azure.cli.core.mock import DummyCli diff --git a/src/azure-cli/azure/cli/command_modules/sqlvm/tests/latest/test_sqlvm_commands.py b/src/azure-cli/azure/cli/command_modules/sqlvm/tests/latest/test_sqlvm_commands.py index d7b32f9b128..7b197109f97 100644 --- a/src/azure-cli/azure/cli/command_modules/sqlvm/tests/latest/test_sqlvm_commands.py +++ b/src/azure-cli/azure/cli/command_modules/sqlvm/tests/latest/test_sqlvm_commands.py @@ -7,7 +7,7 @@ import os import unittest -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse from azure.cli.core.util import CLIError from azure.cli.core.mock import DummyCli diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2019_03_01/recordings/test_storage_blob_metadata_operations.yaml b/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2019_03_01/recordings/test_storage_blob_metadata_operations.yaml index b154bf91c60..07b7b579c48 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2019_03_01/recordings/test_storage_blob_metadata_operations.yaml +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2019_03_01/recordings/test_storage_blob_metadata_operations.yaml @@ -94,7 +94,7 @@ interactions: api_version_constraint)\r\nfrom knack.util import CLIError\r\nfrom azure.cli.core.profiles import ResourceType\r\n\r\nfrom azure.cli.command_modules.storage._client_factory import MISSING_CREDENTIALS_ERROR_MESSAGE\r\nfrom ..storage_test_util import - StorageScenarioMixin\r\nfrom azure_devtools.scenario_tests import AllowLargeResponse\r\n\r\n\r\n@api_version_constraint(ResourceType.MGMT_STORAGE, + StorageScenarioMixin\r\nfrom azure.cli.testsdk.scenario_tests import AllowLargeResponse\r\n\r\n\r\n@api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2016-12-01')\r\nclass StorageBlobUploadTests(StorageScenarioMixin, ScenarioTest):\r\n @ResourceGroupPreparer()\r\n @StorageAccountPreparer(parameter_name='source_account')\r\n \ @StorageAccountPreparer(parameter_name='target_account')\r\n def test_storage_blob_incremental_copy(self, diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2019_03_01/test_storage_account_scenarios.py b/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2019_03_01/test_storage_account_scenarios.py index d9212390261..0ced2b93bf4 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2019_03_01/test_storage_account_scenarios.py +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2019_03_01/test_storage_account_scenarios.py @@ -7,7 +7,7 @@ from azure.cli.core.profiles import ResourceType from ..storage_test_util import StorageScenarioMixin from knack.util import CLIError -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2016-12-01') diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2019_03_01/test_storage_blob_scenarios.py b/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2019_03_01/test_storage_blob_scenarios.py index 340f1f954bb..e69efe9b802 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2019_03_01/test_storage_blob_scenarios.py +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2019_03_01/test_storage_blob_scenarios.py @@ -14,7 +14,7 @@ from azure.cli.command_modules.storage._client_factory import MISSING_CREDENTIALS_ERROR_MESSAGE from ..storage_test_util import StorageScenarioMixin -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2016-12-01') diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2020_09_01/recordings/test_storage_blob_metadata_operations.yaml b/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2020_09_01/recordings/test_storage_blob_metadata_operations.yaml index fadcf7e67e3..218d59c88c0 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2020_09_01/recordings/test_storage_blob_metadata_operations.yaml +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2020_09_01/recordings/test_storage_blob_metadata_operations.yaml @@ -97,7 +97,7 @@ interactions: api_version_constraint)\r\nfrom knack.util import CLIError\r\nfrom azure.cli.core.profiles import ResourceType\r\n\r\nfrom azure.cli.command_modules.storage._client_factory import MISSING_CREDENTIALS_ERROR_MESSAGE\r\nfrom ..storage_test_util import - StorageScenarioMixin\r\nfrom azure_devtools.scenario_tests import AllowLargeResponse\r\n\r\n\r\n@api_version_constraint(ResourceType.MGMT_STORAGE, + StorageScenarioMixin\r\nfrom azure.cli.testsdk.scenario_tests import AllowLargeResponse\r\n\r\n\r\n@api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2016-12-01')\r\nclass StorageBlobUploadTests(StorageScenarioMixin, ScenarioTest):\r\n @ResourceGroupPreparer()\r\n @StorageAccountPreparer(parameter_name='source_account')\r\n \ @StorageAccountPreparer(parameter_name='target_account')\r\n def test_storage_blob_incremental_copy(self, diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2020_09_01/test_storage_account_scenarios.py b/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2020_09_01/test_storage_account_scenarios.py index 1df7238b68d..073782a1942 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2020_09_01/test_storage_account_scenarios.py +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2020_09_01/test_storage_account_scenarios.py @@ -7,7 +7,7 @@ from azure.cli.core.profiles import ResourceType from ..storage_test_util import StorageScenarioMixin from knack.util import CLIError -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2016-12-01') diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2020_09_01/test_storage_blob_scenarios.py b/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2020_09_01/test_storage_blob_scenarios.py index bbd8053d537..39b54f97045 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2020_09_01/test_storage_blob_scenarios.py +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2020_09_01/test_storage_blob_scenarios.py @@ -14,7 +14,7 @@ from azure.cli.command_modules.storage._client_factory import MISSING_CREDENTIALS_ERROR_MESSAGE from ..storage_test_util import StorageScenarioMixin -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2016-12-01') diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/recordings/test_storage_blob_metadata_operations.yaml b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/recordings/test_storage_blob_metadata_operations.yaml index 52a394c9372..a0829ba584b 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/recordings/test_storage_blob_metadata_operations.yaml +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/recordings/test_storage_blob_metadata_operations.yaml @@ -94,7 +94,7 @@ interactions: api_version_constraint)\r\nfrom knack.util import CLIError\r\nfrom azure.cli.core.profiles import ResourceType\r\n\r\nfrom azure.cli.command_modules.storage._client_factory import MISSING_CREDENTIALS_ERROR_MESSAGE\r\nfrom ..storage_test_util import - StorageScenarioMixin\r\nfrom azure_devtools.scenario_tests import AllowLargeResponse\r\n\r\n\r\n@api_version_constraint(ResourceType.MGMT_STORAGE, + StorageScenarioMixin\r\nfrom azure.cli.testsdk.scenario_tests import AllowLargeResponse\r\n\r\n\r\n@api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2016-12-01')\r\nclass StorageBlobUploadTests(StorageScenarioMixin, ScenarioTest):\r\n @ResourceGroupPreparer()\r\n @StorageAccountPreparer(parameter_name='source_account')\r\n \ @StorageAccountPreparer(parameter_name='target_account')\r\n def test_storage_blob_incremental_copy(self, diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_account_scenarios.py b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_account_scenarios.py index a289f3844f5..fc22b70d7db 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_account_scenarios.py +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_account_scenarios.py @@ -14,7 +14,7 @@ from ..storage_test_util import StorageScenarioMixin from knack.util import CLIError from datetime import datetime, timedelta -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2016-12-01') diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_batch_operations.py b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_batch_operations.py index 9c573e77d2a..aa283276815 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_batch_operations.py +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_batch_operations.py @@ -7,7 +7,7 @@ from datetime import datetime from azure.cli.testsdk import LiveScenarioTest, StorageAccountPreparer, ResourceGroupPreparer, JMESPathCheck from ..storage_test_util import StorageScenarioMixin, StorageTestFilesPreparer -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse class StorageBatchOperationScenarios(StorageScenarioMixin, LiveScenarioTest): diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_blob_scenarios.py b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_blob_scenarios.py index 8e11f4e776b..a3e780d03d9 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_blob_scenarios.py +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_blob_scenarios.py @@ -14,7 +14,7 @@ from azure.cli.command_modules.storage._client_factory import MISSING_CREDENTIALS_ERROR_MESSAGE from ..storage_test_util import StorageScenarioMixin -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2016-12-01') diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_container_immutability_policy.py b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_container_immutability_policy.py index 54afff89177..e2c69b9606f 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_container_immutability_policy.py +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_container_immutability_policy.py @@ -5,7 +5,7 @@ from azure.cli.testsdk import (ScenarioTest, JMESPathCheck, ResourceGroupPreparer, StorageAccountPreparer, api_version_constraint) from azure.core.exceptions import HttpResponseError -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse from azure.cli.core.profiles import ResourceType diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_container_legal_hold.py b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_container_legal_hold.py index 039be4d477a..109f4382ccd 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_container_legal_hold.py +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_container_legal_hold.py @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- from azure.cli.testsdk import (ScenarioTest, JMESPathCheck, ResourceGroupPreparer, StorageAccountPreparer, api_version_constraint) -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse from azure.cli.core.profiles import ResourceType diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_container_rm_scenarios.py b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_container_rm_scenarios.py index 2b538f65d73..9d0e38acf3d 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_container_rm_scenarios.py +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_container_rm_scenarios.py @@ -6,7 +6,7 @@ from azure.cli.core.profiles import ResourceType from azure.cli.testsdk import (ScenarioTest, api_version_constraint, ResourceGroupPreparer, StorageAccountPreparer, JMESPathCheck) -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse @api_version_constraint(ResourceType.MGMT_STORAGE, min_api='2019-06-01') diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_encryption_scope_scenarios.py b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_encryption_scope_scenarios.py index d22229acb95..92d5475cb73 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_encryption_scope_scenarios.py +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_encryption_scope_scenarios.py @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- from azure.cli.testsdk import (ScenarioTest, JMESPathCheck, ResourceGroupPreparer, KeyVaultPreparer, StorageAccountPreparer, api_version_constraint, live_only) -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse from azure.cli.core.profiles import ResourceType from knack.util import CLIError diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_file_rm_scenarios.py b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_file_rm_scenarios.py index a430e1bb82c..70fbac6256c 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_file_rm_scenarios.py +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_file_rm_scenarios.py @@ -10,7 +10,7 @@ JMESPathCheck, JMESPathCheckExists) from azure.cli.core.profiles import ResourceType from ..storage_test_util import StorageScenarioMixin -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse class StorageFileShareRmScenarios(StorageScenarioMixin, ScenarioTest): diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_file_scenarios.py b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_file_scenarios.py index 64062a95bf2..2dc12f5502f 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_file_scenarios.py +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_file_scenarios.py @@ -7,7 +7,7 @@ from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer, StorageAccountPreparer, JMESPathCheck, NoneCheck, StringCheck, StringContainCheck, JMESPathCheckExists) from ..storage_test_util import StorageScenarioMixin -from azure_devtools.scenario_tests import record_only +from azure.cli.testsdk.scenario_tests import record_only class StorageFileShareScenarios(StorageScenarioMixin, ScenarioTest): diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_oauth.py b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_oauth.py index a1e30ec1f59..53dd8b183d4 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_oauth.py +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_oauth.py @@ -5,7 +5,7 @@ import os from azure.cli.testsdk import (ScenarioTest, JMESPathCheck, ResourceGroupPreparer, StorageAccountPreparer, api_version_constraint) -from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk.scenario_tests import AllowLargeResponse from azure.cli.core.profiles import ResourceType from ..storage_test_util import StorageScenarioMixin diff --git a/src/azure-cli/azure/cli/command_modules/vm/tests/hybrid_2018_03_01/test_vm_commands.py b/src/azure-cli/azure/cli/command_modules/vm/tests/hybrid_2018_03_01/test_vm_commands.py index 8d0ab823002..5c0bb188062 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/tests/hybrid_2018_03_01/test_vm_commands.py +++ b/src/azure-cli/azure/cli/command_modules/vm/tests/hybrid_2018_03_01/test_vm_commands.py @@ -14,7 +14,7 @@ import uuid from knack.util import CLIError -from azure_devtools.scenario_tests import AllowLargeResponse, record_only +from azure.cli.testsdk.scenario_tests import AllowLargeResponse, record_only from azure.cli.core.profiles import ResourceType from azure.cli.testsdk import ( ScenarioTest, ResourceGroupPreparer, KeyVaultPreparer, LiveScenarioTest, api_version_constraint, diff --git a/src/azure-cli/azure/cli/command_modules/vm/tests/hybrid_2019_03_01/test_vm_commands.py b/src/azure-cli/azure/cli/command_modules/vm/tests/hybrid_2019_03_01/test_vm_commands.py index c2077c8fae2..5a0922ce96a 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/tests/hybrid_2019_03_01/test_vm_commands.py +++ b/src/azure-cli/azure/cli/command_modules/vm/tests/hybrid_2019_03_01/test_vm_commands.py @@ -14,7 +14,7 @@ import uuid from knack.util import CLIError -from azure_devtools.scenario_tests import AllowLargeResponse, record_only +from azure.cli.testsdk.scenario_tests import AllowLargeResponse, record_only from azure.cli.core.profiles import ResourceType from azure.cli.testsdk import ( ScenarioTest, ResourceGroupPreparer, LiveScenarioTest, api_version_constraint, diff --git a/src/azure-cli/azure/cli/command_modules/vm/tests/hybrid_2020_09_01/test_vm_commands.py b/src/azure-cli/azure/cli/command_modules/vm/tests/hybrid_2020_09_01/test_vm_commands.py index ed7306370af..30354dea61c 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/tests/hybrid_2020_09_01/test_vm_commands.py +++ b/src/azure-cli/azure/cli/command_modules/vm/tests/hybrid_2020_09_01/test_vm_commands.py @@ -14,7 +14,7 @@ import uuid from knack.util import CLIError -from azure_devtools.scenario_tests import AllowLargeResponse, record_only +from azure.cli.testsdk.scenario_tests import AllowLargeResponse, record_only from azure.cli.core.profiles import ResourceType from azure.cli.testsdk import ( ScenarioTest, ResourceGroupPreparer, LiveScenarioTest, api_version_constraint, diff --git a/src/azure-cli/azure/cli/command_modules/vm/tests/latest/_test_util.py b/src/azure-cli/azure/cli/command_modules/vm/tests/latest/_test_util.py index 9bf26374fbd..f01d1241410 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/tests/latest/_test_util.py +++ b/src/azure-cli/azure/cli/command_modules/vm/tests/latest/_test_util.py @@ -3,7 +3,7 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -from azure_devtools.scenario_tests import RecordingProcessor +from azure.cli.testsdk.scenario_tests import RecordingProcessor class TimeSpanProcessor(RecordingProcessor): diff --git a/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py b/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py index c797cc7f51f..d4b387bd331 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py +++ b/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py @@ -15,7 +15,7 @@ from azure.cli.testsdk.exceptions import JMESPathCheckAssertionError from knack.util import CLIError -from azure_devtools.scenario_tests import AllowLargeResponse, record_only, live_only +from azure.cli.testsdk.scenario_tests import AllowLargeResponse, record_only, live_only from azure.cli.core.azclierror import ArgumentUsageError from azure.cli.core.profiles import ResourceType from azure.cli.testsdk import (