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
4 changes: 2 additions & 2 deletions sdk/monitor/azure-mgmt-monitor/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release History

## 7.0.0b1 (2025-02-06)
## 7.0.0b1 (2025-02-07)

### Features Added

Expand Down Expand Up @@ -234,7 +234,7 @@
### Breaking Changes

- Deleted or renamed client operation group `MonitorManagementClient.tenant_action_groups`
- Method `MonitorManagementClient.__init__` inserted a `positional_or_keyword` parameter `subscription_id`
- Parameter `subscription_id` of client `MonitorManagementClient` is now required
- Deleted or renamed model `TenantActionGroupList`
- Deleted or renamed model `TenantActionGroupResource`
- Deleted or renamed model `TenantActionGroupsOperations`
Expand Down
6 changes: 0 additions & 6 deletions sdk/monitor/azure-mgmt-monitor/assets.json

This file was deleted.

12 changes: 7 additions & 5 deletions sdk/monitor/azure-mgmt-monitor/tests/_aio_testcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from azure.core.credentials import AccessToken
from devtools_testutils import AzureMgmtRecordedTestCase


class AzureMgmtAsyncTestCase(AzureMgmtRecordedTestCase):

def setUp(self):
Expand All @@ -16,18 +17,19 @@ 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.settings.SUBSCRIPTION_ID
)
credential = Mock(
spec_set=["get_token"], get_token=asyncio.coroutine(lambda _: AccessToken("fake-token", 0))
)
return client(credential=credential, subscription_id=self.settings.SUBSCRIPTION_ID)

def to_list(self, ait):
async def lst():
result = []
async for item in ait:
result.append(item)
return result

return self.event_loop.run_until_complete(lst())
64 changes: 22 additions & 42 deletions sdk/monitor/azure-mgmt-monitor/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,55 +1,35 @@
# coding=utf-8
# --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import os
import platform
import pytest
import sys

from dotenv import load_dotenv

from devtools_testutils import test_proxy, add_general_regex_sanitizer
from devtools_testutils import add_header_regex_sanitizer, add_body_key_sanitizer

# Ignore async tests for Python < 3.5
collect_ignore_glob = []
if sys.version_info < (3, 5) or platform.python_implementation() == "PyPy":
collect_ignore_glob.append("*_async.py")
from devtools_testutils import (
test_proxy,
add_general_regex_sanitizer,
add_body_key_sanitizer,
add_header_regex_sanitizer,
)

load_dotenv()


# For security, please avoid record sensitive identity information in recordings
@pytest.fixture(scope="session", autouse=True)
def add_sanitizers(test_proxy):
subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000")
tenant_id = os.environ.get("AZURE_TENANT_ID", "00000000-0000-0000-0000-000000000000")
client_id = os.environ.get("AZURE_CLIENT_ID", "00000000-0000-0000-0000-000000000000")
client_secret = os.environ.get("AZURE_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000")
add_general_regex_sanitizer(regex=subscription_id, value="00000000-0000-0000-0000-000000000000")
add_general_regex_sanitizer(regex=tenant_id, value="00000000-0000-0000-0000-000000000000")
add_general_regex_sanitizer(regex=client_id, value="00000000-0000-0000-0000-000000000000")
add_general_regex_sanitizer(regex=client_secret, value="00000000-0000-0000-0000-000000000000")
monitormanagement_subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000")
monitormanagement_tenant_id = os.environ.get("AZURE_TENANT_ID", "00000000-0000-0000-0000-000000000000")
monitormanagement_client_id = os.environ.get("AZURE_CLIENT_ID", "00000000-0000-0000-0000-000000000000")
monitormanagement_client_secret = os.environ.get("AZURE_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000")
add_general_regex_sanitizer(regex=monitormanagement_subscription_id, value="00000000-0000-0000-0000-000000000000")
add_general_regex_sanitizer(regex=monitormanagement_tenant_id, value="00000000-0000-0000-0000-000000000000")
add_general_regex_sanitizer(regex=monitormanagement_client_id, value="00000000-0000-0000-0000-000000000000")
add_general_regex_sanitizer(regex=monitormanagement_client_secret, value="00000000-0000-0000-0000-000000000000")

add_header_regex_sanitizer(key="Set-Cookie", value="[set-cookie;]")
add_header_regex_sanitizer(key="Cookie", value="cookie;")
add_body_key_sanitizer(json_path="$..access_token", value="access_token")
add_body_key_sanitizer(json_path="$..access_token", value="access_token")
Loading
Loading