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 18, 2024
commit 9edf8f86a56bcdc08d8df17a365ddb889c703592
2 changes: 1 addition & 1 deletion sdk/cosmos/azure-mgmt-cosmosdb/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release History

## 9.7.0 (2024-12-23)
## 9.7.0 (2024-11-18)

### Features Added

Expand Down
8 changes: 5 additions & 3 deletions sdk/cosmos/azure-mgmt-cosmosdb/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
1,895 changes: 1,133 additions & 762 deletions sdk/cosmos/azure-mgmt-cosmosdb/tests/disable_test_cli_mgmt_cosmosdb.py

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# coding: utf-8

#-------------------------------------------------------------------------
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------
# --------------------------------------------------------------------------

# Current Operation Coverage:
# NotebookWorkspaces: 0/7
Expand All @@ -14,17 +14,16 @@
import azure.mgmt.cosmosdb
from devtools_testutils import AzureMgmtTestCase, RandomNameResourceGroupPreparer, ResourceGroupPreparer

AZURE_LOCATION = 'eastus'
AZURE_LOCATION = "eastus"


class MgmtCosmosDBTest(AzureMgmtTestCase):

def setUp(self):
super(MgmtCosmosDBTest, self).setUp()
self.mgmt_client = self.create_mgmt_client(
azure.mgmt.cosmosdb.CosmosDBManagementClient
)

@unittest.skip('hard to test')
self.mgmt_client = self.create_mgmt_client(azure.mgmt.cosmosdb.CosmosDBManagementClient)

@unittest.skip("hard to test")
@ResourceGroupPreparer(location=AZURE_LOCATION)
def test_notebook_workspace(self, resource_group):

Expand All @@ -33,67 +32,94 @@ def test_notebook_workspace(self, resource_group):
DATABASE_NAME = "myDatabase"
NOTEBOOK_WORKSPACE_NAME = "myNotebookWorkspace"

#--------------------------------------------------------------------------
# --------------------------------------------------------------------------
# /DatabaseAccounts/put/CosmosDBDatabaseAccountCreateMin[put]
#--------------------------------------------------------------------------
# --------------------------------------------------------------------------
BODY = {
"location": AZURE_LOCATION,
"kind": "GlobalDocumentDB",
"database_account_offer_type": "Standard",
"locations": [
{
"location_name": "eastus",
"is_zone_redundant": False,
"failover_priority": "0"
},
],
"api_properties": {}
"location": AZURE_LOCATION,
"kind": "GlobalDocumentDB",
"database_account_offer_type": "Standard",
"locations": [
{"location_name": "eastus", "is_zone_redundant": False, "failover_priority": "0"},
],
"api_properties": {},
}
result = self.mgmt_client.database_accounts.begin_create_or_update(resource_group_name=RESOURCE_GROUP, account_name=ACCOUNT_NAME, create_update_parameters=BODY)
result = self.mgmt_client.database_accounts.begin_create_or_update(
resource_group_name=RESOURCE_GROUP, account_name=ACCOUNT_NAME, create_update_parameters=BODY
)
result = result.result()

#--------------------------------------------------------------------------
# --------------------------------------------------------------------------
# /NotebookWorkspaces/put/CosmosDBNotebookWorkspaceCreate[put]
#--------------------------------------------------------------------------
# --------------------------------------------------------------------------
BODY = {}
result = self.mgmt_client.notebook_workspaces.begin_create_or_update(resource_group_name=RESOURCE_GROUP, account_name=ACCOUNT_NAME, notebook_workspace_name=NOTEBOOK_WORKSPACE_NAME, notebook_create_update_parameters=BODY)
result = self.mgmt_client.notebook_workspaces.begin_create_or_update(
resource_group_name=RESOURCE_GROUP,
account_name=ACCOUNT_NAME,
notebook_workspace_name=NOTEBOOK_WORKSPACE_NAME,
notebook_create_update_parameters=BODY,
)
result = result.result()

#--------------------------------------------------------------------------
# --------------------------------------------------------------------------
# /NotebookWorkspaces/get/CosmosDBNotebookWorkspaceGet[get]
#--------------------------------------------------------------------------
result = self.mgmt_client.notebook_workspaces.get(resource_group_name=RESOURCE_GROUP, account_name=ACCOUNT_NAME, notebook_workspace_name=NOTEBOOK_WORKSPACE_NAME)
# --------------------------------------------------------------------------
result = self.mgmt_client.notebook_workspaces.get(
resource_group_name=RESOURCE_GROUP,
account_name=ACCOUNT_NAME,
notebook_workspace_name=NOTEBOOK_WORKSPACE_NAME,
)

#--------------------------------------------------------------------------
# --------------------------------------------------------------------------
# /NotebookWorkspaces/get/CosmosDBNotebookWorkspaceList[get]
#--------------------------------------------------------------------------
result = self.mgmt_client.notebook_workspaces.list_by_database_account(resource_group_name=RESOURCE_GROUP, account_name=ACCOUNT_NAME)
# --------------------------------------------------------------------------
result = self.mgmt_client.notebook_workspaces.list_by_database_account(
resource_group_name=RESOURCE_GROUP, account_name=ACCOUNT_NAME
)

#--------------------------------------------------------------------------
# --------------------------------------------------------------------------
# /NotebookWorkspaces/post/CosmosDBNotebookWorkspaceRegenerateAuthToken[post]
#--------------------------------------------------------------------------
result = self.mgmt_client.notebook_workspaces.begin_regenerate_auth_token(resource_group_name=RESOURCE_GROUP, account_name=ACCOUNT_NAME, notebook_workspace_name=NOTEBOOK_WORKSPACE_NAME)
# --------------------------------------------------------------------------
result = self.mgmt_client.notebook_workspaces.begin_regenerate_auth_token(
resource_group_name=RESOURCE_GROUP,
account_name=ACCOUNT_NAME,
notebook_workspace_name=NOTEBOOK_WORKSPACE_NAME,
)
result = result.result()

#--------------------------------------------------------------------------
# --------------------------------------------------------------------------
# /NotebookWorkspaces/post/CosmosDBNotebookWorkspaceListConnectionInfo[post]
#--------------------------------------------------------------------------
result = self.mgmt_client.notebook_workspaces.list_connection_info(resource_group_name=RESOURCE_GROUP, account_name=ACCOUNT_NAME, notebook_workspace_name=NOTEBOOK_WORKSPACE_NAME)
# --------------------------------------------------------------------------
result = self.mgmt_client.notebook_workspaces.list_connection_info(
resource_group_name=RESOURCE_GROUP,
account_name=ACCOUNT_NAME,
notebook_workspace_name=NOTEBOOK_WORKSPACE_NAME,
)

#--------------------------------------------------------------------------
# --------------------------------------------------------------------------
# /NotebookWorkspaces/post/CosmosDBNotebookWorkspaceStart[post]
#--------------------------------------------------------------------------
result = self.mgmt_client.notebook_workspaces.begin_start(resource_group_name=RESOURCE_GROUP, account_name=ACCOUNT_NAME, notebook_workspace_name=NOTEBOOK_WORKSPACE_NAME)
# --------------------------------------------------------------------------
result = self.mgmt_client.notebook_workspaces.begin_start(
resource_group_name=RESOURCE_GROUP,
account_name=ACCOUNT_NAME,
notebook_workspace_name=NOTEBOOK_WORKSPACE_NAME,
)
result = result.result()

#--------------------------------------------------------------------------
# --------------------------------------------------------------------------
# /NotebookWorkspaces/delete/CosmosDBNotebookWorkspaceDelete[delete]
#--------------------------------------------------------------------------
result = self.mgmt_client.notebook_workspaces.begin_delete(resource_group_name=RESOURCE_GROUP, account_name=ACCOUNT_NAME, notebook_workspace_name=NOTEBOOK_WORKSPACE_NAME)
# --------------------------------------------------------------------------
result = self.mgmt_client.notebook_workspaces.begin_delete(
resource_group_name=RESOURCE_GROUP,
account_name=ACCOUNT_NAME,
notebook_workspace_name=NOTEBOOK_WORKSPACE_NAME,
)
result = result.result()

#--------------------------------------------------------------------------
# --------------------------------------------------------------------------
# /DatabaseAccounts/delete/CosmosDBDatabaseAccountDelete[delete]
#--------------------------------------------------------------------------
result = self.mgmt_client.database_accounts.begin_delete(resource_group_name=RESOURCE_GROUP, account_name=ACCOUNT_NAME)
# --------------------------------------------------------------------------
result = self.mgmt_client.database_accounts.begin_delete(
resource_group_name=RESOURCE_GROUP, account_name=ACCOUNT_NAME
)
result = result.result()
Loading