Skip to content

Commit

Permalink
{testsdk} Migrate azure-devtools to azure-cli-testsdk (#4211)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhoxing-ms committed Dec 10, 2021
1 parent 5e714bb commit b648b31
Show file tree
Hide file tree
Showing 68 changed files with 76 additions and 71 deletions.
2 changes: 1 addition & 1 deletion pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ disable=

[TYPECHECK]
# For Azure CLI extensions, we ignore some import errors as they'll be available in the environment of the CLI
ignored-modules=azure,azure.cli,azure.cli.core,azure.cli.core.commands,knack,msrestazure,argcomplete,azure_devtools,isodate,OpenSSL
ignored-modules=azure,azure.cli,azure.cli.core,azure.cli.core.commands,knack,msrestazure,argcomplete,azure.cli.testsdk,isodate,OpenSSL

[FORMAT]
max-line-length=120
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import unittest
import time

from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk.scenario_tests import AllowLargeResponse
from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer)


Expand Down
2 changes: 1 addition & 1 deletion src/ad/azext_ad/tests/latest/preparers.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import os
from datetime import datetime
from azure_devtools.scenario_tests import SingleValueReplacer
from azure.cli.testsdk.scenario_tests import SingleValueReplacer
from azure.cli.testsdk.preparers import NoTrafficRecordingPreparer
from azure.cli.testsdk.exceptions import CliTestError
from azure.cli.testsdk.reverse_dependency import get_dummy_cli
Expand Down
2 changes: 1 addition & 1 deletion src/aem/azext_aem/tests/latest/test_aem_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer)
from azure.cli.core.util import CLIError
from azext_aem.custom import EnhancedMonitoring # pylint: disable=unused-import
from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk.scenario_tests import AllowLargeResponse
import os
import sys
# pylint: disable=unused-argument,too-few-public-methods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from unittest import mock
import requests

from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk.scenario_tests import AllowLargeResponse
from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer)
from azext_ai_examples.custom import (call_aladdin_service, ping_aladdin_service,
clean_from_http_answer, get_generated_examples)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from azure.cli.testsdk import (
ResourceGroupPreparer, RoleBasedServicePrincipalPreparer, ScenarioTest, live_only)
from azure.cli.command_modules.acs._format import version_to_tuple
from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk.scenario_tests import AllowLargeResponse
from knack.util import CLIError

from .recording_processors import KeyReplacer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,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)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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


def _py3_byte_to_str(byte_or_str):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# pylint: disable=line-too-long
from azure.cli.testsdk import ResourceGroupPreparer, ScenarioTest, StorageAccountPreparer
from .recording_processors import StorageAccountSASReplacer
from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk.scenario_tests import AllowLargeResponse


class ApplicationInsightsManagementClientTests(ScenarioTest):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import unittest
import base64

from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk.scenario_tests import AllowLargeResponse
from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer, RoleBasedServicePrincipalPreparer, live_only)

TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import os
from datetime import datetime
from azure_devtools.scenario_tests import SingleValueReplacer
from azure.cli.testsdk.scenario_tests import SingleValueReplacer
from azure.cli.testsdk.preparers import NoTrafficRecordingPreparer
from azure.cli.testsdk.exceptions import CliTestError
from azure.cli.testsdk.reverse_dependency import get_dummy_cli
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,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, JMESPathCheck)

TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..'))
Expand Down
2 changes: 1 addition & 1 deletion src/blockchain/azext_blockchain/tests/latest/preparers.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import os
from datetime import datetime
from azure_devtools.scenario_tests import SingleValueReplacer
from azure.cli.testsdk.scenario_tests import SingleValueReplacer

from azure.cli.testsdk.preparers import NoTrafficRecordingPreparer
from azure.cli.testsdk.exceptions import CliTestError
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,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
from .. import try_manual
from azure.cli.testsdk import ResourceGroupPreparer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from pathlib import Path
import shutil

from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk.scenario_tests import AllowLargeResponse
from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer,
JMESPathCheck, JMESPathCheckExists,
NoneCheck)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,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, live_only)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from .example_steps import step_organization_list2
from .example_steps import step_organization_update
from .example_steps import step_organization_delete
from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk.scenario_tests import AllowLargeResponse
from .. import (
try_manual,
raise_if,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import time

from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer
from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk.scenario_tests import AllowLargeResponse

from .test_confluent_scenario import mock_jwt_decode, mock_list_role_assignments

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import unittest

from azure.cli.testsdk import (LiveScenarioTest, ResourceGroupPreparer) # pylint: disable=import-error
from azure_devtools.scenario_tests import AllowLargeResponse # pylint: disable=import-error
from azure.cli.testsdk.scenario_tests import AllowLargeResponse # pylint: disable=import-error


TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,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
from knack.util import CLIError
from azure.cli.testsdk import ScenarioTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,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)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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__), '..'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import os
from datetime import datetime
from azure.cli.testsdk.preparers import NoTrafficRecordingPreparer
from azure_devtools.scenario_tests import SingleValueReplacer
from azure.cli.testsdk.scenario_tests import SingleValueReplacer
from azure.cli.testsdk.exceptions import CliTestError
from azure.cli.testsdk.reverse_dependency import get_dummy_cli

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,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
# from .. import try_manual
# from azure.cli.testsdk import ResourceGroupPreparer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,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, ResourceGroupPreparer, KeyVaultPreparer)
from msrestazure.tools import resource_id

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from unittest import mock
from azure.cli.testsdk import ScenarioTest
from azure.cli.testsdk import ResourceGroupPreparer
from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk.scenario_tests import AllowLargeResponse
from .. import try_manual, raise_if, calc_coverage


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,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)

TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..'))
Expand Down
2 changes: 1 addition & 1 deletion src/diskpool/azext_diskpool/tests/latest/preparers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# regenerated.
# --------------------------------------------------------------------------

from azure_devtools.scenario_tests import SingleValueReplacer
from azure.cli.testsdk.scenario_tests import SingleValueReplacer
from azure.cli.testsdk.preparers import NoTrafficRecordingPreparer
from azure.cli.testsdk.reverse_dependency import get_dummy_cli

Expand Down
2 changes: 1 addition & 1 deletion src/dnc/azext_dnc/manual/tests/latest/preparers.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import os
from datetime import datetime
from azure_devtools.scenario_tests import SingleValueReplacer
from azure.cli.testsdk.scenario_tests import SingleValueReplacer
from azure.cli.testsdk.preparers import NoTrafficRecordingPreparer
from azure.cli.testsdk.exceptions import CliTestError
from azure.cli.testsdk.reverse_dependency import get_dummy_cli
Expand Down
2 changes: 1 addition & 1 deletion src/dnc/azext_dnc/tests/latest/preparers.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import os
from datetime import datetime
from azure_devtools.scenario_tests import SingleValueReplacer
from azure.cli.testsdk.scenario_tests import SingleValueReplacer
from azure.cli.testsdk.preparers import NoTrafficRecordingPreparer
from azure.cli.testsdk.exceptions import CliTestError
from azure.cli.testsdk.reverse_dependency import get_dummy_cli
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,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
from .. import try_manual
from azure.cli.testsdk import ResourceGroupPreparer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from azure.cli.testsdk.exceptions import CliTestError
from azure.cli.testsdk.preparers import NoTrafficRecordingPreparer
from azure.cli.testsdk.reverse_dependency import get_dummy_cli
from azure_devtools.scenario_tests import SingleValueReplacer
from azure.cli.testsdk.scenario_tests import SingleValueReplacer


KEY_RESOURCE_GROUP = 'rg'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import os
from unittest import mock

from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk.scenario_tests import AllowLargeResponse
from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer, StorageAccountPreparer


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,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)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,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)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from azure.cli.testsdk import ScenarioTest
from azure.cli.testsdk import ResourceGroupPreparer
from azure.cli.testsdk import StorageAccountPreparer
from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk.scenario_tests import AllowLargeResponse
from .. import (
try_manual,
raise_if,
Expand Down
2 changes: 1 addition & 1 deletion src/kusto/azext_kusto/tests/latest/test_kusto_scenario.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from azure.cli.testsdk import ScenarioTest
from azure.cli.testsdk import ResourceGroupPreparer
from azure.cli.testsdk import StorageAccountPreparer
from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk.scenario_tests import AllowLargeResponse
from .. import (
try_manual,
raise_if,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,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)
from knack.util import CLIError

Expand Down
2 changes: 1 addition & 1 deletion src/logic/azext_logic/tests/latest/test_logic_scenario.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import unittest

from azure.cli.testsdk import JMESPathCheck
from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk.scenario_tests import AllowLargeResponse
from azure.cli.testsdk import ScenarioTest
from azure.cli.testsdk import ResourceGroupPreparer

Expand Down
4 changes: 2 additions & 2 deletions src/logz/azext_logz/tests/latest/test_logz_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
ResourceGroupPreparer,
ScenarioTest
)
from azure_devtools.scenario_tests import (
from azure.cli.testsdk.scenario_tests import (
RecordingProcessor,
live_only
)
from azure_devtools.scenario_tests.utilities import is_text_payload
from azure.cli.testsdk.scenario_tests.utilities import is_text_payload


class CredentialReplacer(RecordingProcessor):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import os
from datetime import datetime
from azure_devtools.scenario_tests import SingleValueReplacer
from azure.cli.testsdk.scenario_tests import SingleValueReplacer
from azure.cli.testsdk.preparers import NoTrafficRecordingPreparer
from azure.cli.testsdk.exceptions import CliTestError
from azure.cli.testsdk.reverse_dependency import get_dummy_cli
Expand Down
Loading

0 comments on commit b648b31

Please sign in to comment.