1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
# 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.
# --------------------------------------------------------------------------
import functools
from devtools_testutils import AzureRecordedTestCase, PowerShellPreparer
from azure.purview.sharing import PurviewSharingClient
class TestPurviewSharing(AzureRecordedTestCase):
def create_client(self, endpoint):
credential = self.get_credential(PurviewSharingClient)
return self.create_client_from_credential(
PurviewSharingClient,
credential=credential,
endpoint=endpoint,
)
def prepare_sent_share(self):
artifact = {
"properties": {
"paths": [
{
"containerName": "container1",
"receiverPath": "folder1",
"senderPath": "folder1"
}
]
},
"storeKind": "AdlsGen2Account",
"storeReference": {
# cspell:disable-next-line
"referenceName": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/fakeResourceGroup/providers/Microsoft.Storage/storageAccounts/fakeStorageAccount",
"type": "ArmResourceReference"
}
}
sent_share = {
"properties": {
"artifact": artifact,
"displayName": "sentShare-Test",
"description": "A sample share"
},
"shareKind": "InPlace"
}
return sent_share
PurviewSharingPowerShellPreparer = functools.partial(
PowerShellPreparer,
"purviewsharing",
purviewsharing_endpoint="https://fake_account.share.purview.azure.com"
)
|