Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
update-testcase
  • Loading branch information
ChenxiJiang333 committed Nov 1, 2024
commit cb8fd93a624bd9bd21d248a0283cc564f50529cd
850 changes: 2 additions & 848 deletions sdk/network/azure-mgmt-network/CHANGELOG.md

Large diffs are not rendered by default.

30 changes: 0 additions & 30 deletions sdk/network/azure-mgmt-network/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,4 @@
],
"autorest_command": "autorest specification/network/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.19.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
"readme": "specification/network/resource-manager/readme.md",
"package-2015-06split": "2019-06-13 02:17:06 +0300 f0f79bfa8191ac30cfb0f87665411769bd2063a6 Microsoft.Network/stable/2015-06-15/virtualNetworkGateway.json",
"package-2017-10": "2019-06-13 02:23:37 +0300 e19543a6a361096e5ca11a42424a39025fd008fa Microsoft.Network/stable/2017-10-01/applicationGateway.json",
"package-2018-04": "2019-06-13 02:23:37 +0300 e19543a6a361096e5ca11a42424a39025fd008fa Microsoft.Network/stable/2018-04-01/applicationGateway.json",
"package-2018-11": "2020-05-09 06:55:46 +0200 42d96397744ec1e6e837a06879d6e43a13f8bc33 Microsoft.Network/stable/2018-11-01/publicIpPrefix.json",
"package-2018-12": "2021-05-11 02:02:27 -0700 e729721df20047dcb4fdb675d234b6821f1a4f81 Microsoft.Network/stable/2018-12-01/applicationGateway.json",
"package-2019-02": "2021-05-11 02:02:27 -0700 e729721df20047dcb4fdb675d234b6821f1a4f81 Microsoft.Network/stable/2019-02-01/applicationGateway.json",
"package-2019-04": "2021-05-11 02:02:27 -0700 e729721df20047dcb4fdb675d234b6821f1a4f81 Microsoft.Network/stable/2019-04-01/applicationGateway.json",
"package-2019-06": "2021-05-11 02:02:27 -0700 e729721df20047dcb4fdb675d234b6821f1a4f81 Microsoft.Network/stable/2019-06-01/applicationGateway.json",
"package-2019-07": "2021-05-11 02:02:27 -0700 e729721df20047dcb4fdb675d234b6821f1a4f81 Microsoft.Network/stable/2019-07-01/applicationGateway.json",
"package-2019-08": "2021-05-11 02:02:27 -0700 e729721df20047dcb4fdb675d234b6821f1a4f81 Microsoft.Network/stable/2019-08-01/applicationGateway.json",
"package-2019-09": "2021-05-11 02:02:27 -0700 e729721df20047dcb4fdb675d234b6821f1a4f81 Microsoft.Network/stable/2019-09-01/applicationGateway.json",
"package-2019-11": "2021-05-11 02:02:27 -0700 e729721df20047dcb4fdb675d234b6821f1a4f81 Microsoft.Network/stable/2019-11-01/applicationGateway.json",
"package-2019-12": "2021-05-11 02:02:27 -0700 e729721df20047dcb4fdb675d234b6821f1a4f81 Microsoft.Network/stable/2019-12-01/applicationGateway.json",
"package-2020-03": "2021-05-11 02:02:27 -0700 e729721df20047dcb4fdb675d234b6821f1a4f81 Microsoft.Network/stable/2020-03-01/applicationGateway.json",
"package-2020-04": "2021-05-11 02:02:27 -0700 e729721df20047dcb4fdb675d234b6821f1a4f81 Microsoft.Network/stable/2020-04-01/applicationGateway.json",
"package-2020-05": "2021-05-11 02:02:27 -0700 e729721df20047dcb4fdb675d234b6821f1a4f81 Microsoft.Network/stable/2020-05-01/applicationGateway.json",
"package-2020-06": "2021-05-11 02:02:27 -0700 e729721df20047dcb4fdb675d234b6821f1a4f81 Microsoft.Network/stable/2020-06-01/applicationGateway.json",
"package-2020-07": "2021-05-11 02:02:27 -0700 e729721df20047dcb4fdb675d234b6821f1a4f81 Microsoft.Network/stable/2020-07-01/applicationGateway.json",
"package-2020-08": "2024-07-30 15:56:06 -0700 61fdc4621a644bb2b2b5606344139c93765e5518 Microsoft.Network/stable/2020-08-01/routeTable.json",
"package-2020-11": "2024-07-30 15:56:06 -0700 61fdc4621a644bb2b2b5606344139c93765e5518 Microsoft.Network/stable/2020-11-01/routeTable.json",
"package-2021-02-preview-only": "2023-10-12 23:38:35 +0530 dac9f85a47b0e4e759593f3a19968a732b911b47 Microsoft.Network/preview/2021-02-01-preview/networkSecurityPerimeter.json",
"package-2021-02": "2024-07-30 15:56:06 -0700 61fdc4621a644bb2b2b5606344139c93765e5518 Microsoft.Network/stable/2021-02-01/routeTable.json",
"package-2023-02": "2024-07-30 15:56:06 -0700 61fdc4621a644bb2b2b5606344139c93765e5518 Microsoft.Network/stable/2023-02-01/routeTable.json",
"package-2023-04": "2024-07-30 15:56:06 -0700 61fdc4621a644bb2b2b5606344139c93765e5518 Microsoft.Network/stable/2023-04-01/routeTable.json",
"package-2023-05": "2024-08-05 12:48:36 +0800 1e154af1a0863ad77e5a8959b3e90d2d10fadf1c Microsoft.Network/stable/2023-05-01/ipAllocation.json",
"package-2023-06": "2024-08-05 12:53:37 +0800 026a93a50d8e8151433d45d18af3b6ec342d3bea Microsoft.Network/stable/2023-06-01/ipAllocation.json",
"package-2023-09": "2024-08-05 12:54:01 +0800 0699892cadd5825057a797244d8b704e6529631d Microsoft.Network/stable/2023-09-01/ipAllocation.json",
"package-2023-11": "2024-08-05 18:42:45 -0700 9fc2f7eda170fad2fe721788d2824e572a6c4c38 Microsoft.Network/stable/2023-11-01/securityPartnerProvider.json",
"package-2024-01": "2024-09-09 15:04:01 -0700 1ad29756bd141a47cac770140105a706d065ae1b Microsoft.Network/preview/2024-01-01-preview/networkVerifier.json",
"package-2024-03": "2024-08-27 11:05:40 +0530 5164430697eba3c27388fe9112de8eba40f85664 Microsoft.Network/stable/2024-03-01/vmssPublicIpAddress.json"
}
8 changes: 5 additions & 3 deletions sdk/network/azure-mgmt-network/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@

# Version extraction inspired from 'requests'
with open(
os.path.join(package_folder_path, "version.py")
if os.path.exists(os.path.join(package_folder_path, "version.py"))
else os.path.join(package_folder_path, "_version.py"),
(
os.path.join(package_folder_path, "version.py")
if os.path.exists(os.path.join(package_folder_path, "version.py"))
else os.path.join(package_folder_path, "_version.py")
),
"r",
) as fd:
version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1)
Expand Down
10 changes: 5 additions & 5 deletions sdk/network/azure-mgmt-network/tests/_aio_testcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ def event_loop(self):
def create_mgmt_aio_client(self, client, **kwargs):
if self.is_live:
from azure.identity.aio import DefaultAzureCredential

credential = DefaultAzureCredential()
else:
credential = Mock(spec_set=["get_token"], get_token=asyncio.coroutine(lambda _: AccessToken("fake-token", 0)))
return client(
credential=credential,
subscription_id=self.get_settings_value("SUBSCRIPTION_ID")
)
credential = Mock(
spec_set=["get_token"], get_token=asyncio.coroutine(lambda _: AccessToken("fake-token", 0))
)
return client(credential=credential, subscription_id=self.get_settings_value("SUBSCRIPTION_ID"))

def to_list(self, ait):
async def lst():
Expand Down
4 changes: 2 additions & 2 deletions sdk/network/azure-mgmt-network/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
add_general_regex_sanitizer,
add_body_key_sanitizer,
add_header_regex_sanitizer,
remove_batch_sanitizers
remove_batch_sanitizers,
)

load_dotenv()
Expand All @@ -36,7 +36,7 @@ def add_sanitizers(test_proxy):
add_header_regex_sanitizer(key="Set-Cookie", value="[set-cookie;]")
add_header_regex_sanitizer(key="Cookie", value="cookie;")
add_body_key_sanitizer(json_path="$..access_token", value="access_token")

# Remove the following sanitizers since certain fields are needed in tests and are non-sensitive:
# - AZSDK3493: $..name
# - AZSDK2003: Location
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@

TEST_API_VERSION = "2021-02-01"


def raw_requst_check(request):
assert request.http_request.query["api-version"] == TEST_API_VERSION



@pytest.mark.live_test_only
class TestMgmtNetworkApiVersion(AzureMgmtRecordedTestCase):
def setup_method(self, method):
Expand All @@ -38,11 +40,13 @@ def test_api_version(self, resource_group):
assert len(result) == 0

# check whether api version is passed to request for mixin operation group
self.mgmt_client.check_dns_name_availability(location="eastus", domain_name_label="mydomain", raw_request_hook=raw_requst_check)
self.mgmt_client.check_dns_name_availability(
location="eastus", domain_name_label="mydomain", raw_request_hook=raw_requst_check
)

def fake_client(self, api_version):
return NetworkManagementClient(credential="", subscription_id="", api_version=api_version)

def test_invalid_api_version(self):
client = self.fake_client(api_version="1000-01-01")
# normal operation group
Expand All @@ -52,5 +56,3 @@ def test_invalid_api_version(self):
# mixin operation group
with pytest.raises(ValueError):
client.check_dns_name_availability(location="eastus", domain_name_label="mydomain")


Loading