File: test_workspace_test.py

package info (click to toggle)
python-azure 20250603%2Bgit-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 851,724 kB
  • sloc: python: 7,362,925; ansic: 804; javascript: 287; makefile: 195; sh: 145; xml: 109
file content (21 lines) | stat: -rw-r--r-- 843 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import pytest
import azure.mgmt.loganalytics
from devtools_testutils import AzureMgmtRecordedTestCase, recorded_by_proxy, ResourceGroupPreparer


@pytest.mark.live_test_only
class TestMgmtLogAnalyticsWorkspace(AzureMgmtRecordedTestCase):

    def setup_method(self, method):
        self.client = self.create_mgmt_client(azure.mgmt.loganalytics.LogAnalyticsManagementClient)

    @ResourceGroupPreparer()
    @recorded_by_proxy
    def test_loganalytics_workspace(self, resource_group, location):
        workspace_name = "WorkspaceName"
        workspace_result = self.client.workspaces.begin_create_or_update(
            resource_group.name, workspace_name, {"location": location}
        ).result()

        workspace = self.client.workspaces.get(resource_group.name, workspace_name)
        assert workspace_result.name == workspace.name