def test_source_storage_account_err_case(self): np = mock.MagicMock() np.source_storage_account_id = '/subscriptions/123/resourceGroups/ygsrc/providers/Microsoft.Storage/storageAccounts/s123' np.source = '/subscriptions/123/resourceGroups/yugangw/providers/Microsoft.Compute/disks/d2' # action (should throw) with self.assertRaises(CLIError): process_disk_or_snapshot_create_namespace(np) # with blob uri, should be fine np.source = 'https://s1.blob.core.windows.net/vhds/s1.vhd' process_disk_or_snapshot_create_namespace(np)
def test_source_storage_account_err_case(self): np = mock.MagicMock() np.source_storage_account_id = '/subscriptions/123/resourceGroups/ygsrc/providers/Microsoft.Storage/storageAccounts/s123' np.source = '/subscriptions/123/resourceGroups/yugangw/providers/Microsoft.Compute/disks/d2' # action (should throw) with self.assertRaises(CLIError): process_disk_or_snapshot_create_namespace(np) # with blob uri, should be fine np.source = 'https://s1.blob.core.windows.net/vhds/s1.vhd' process_disk_or_snapshot_create_namespace(np)