  def testCreateDiskFromSnapshotUri(self,
                                    mock_create_disk,
                                    mock_create_storage_account,
                                    mock_delete_storage_account,
                                    mock_blob_client,
                                    mock_get_container,
                                    mock_get_blob_client,
                                    mock_blob_storage,
                                    mock_create_container,
                                    mock_provider):
    """Test that a disk can be created from a snapshot URI."""
    mock_provider.return_value = azure_mocks.MOCK_CAPACITY_PROVIDER
    # pylint: disable=line-too-long
    mock_create_disk.return_value.done.return_value = True
    mock_create_disk.return_value.result.return_value = azure_mocks.MOCK_DISK_COPY
    mock_create_storage_account.return_value = ('fake-account-id', 'fake-key')
    mock_blob_client.return_value = None
    mock_blob_storage.return_value = None
    mock_get_container.return_value = mock.Mock()
    mock_create_container.return_value = None
    blob_properties = mock_get_blob_client.return_value.get_blob_properties
    blob_properties.return_value = mock.Mock(copy=mock.Mock(status='success'))
    mock_delete_storage_account.return_value = None

    disk_from_snapshot_uri = azure_mocks.FAKE_ACCOUNT.compute.CreateDiskFromSnapshotURI(
        azure_mocks.FAKE_SNAPSHOT, 'fake-snapshot-uri')
    #  hashlib.sha1('/a/b/c/fake-resource-group/fake_snapshot_name'.encode(
    #     'utf-8')).hexdigest()[:23] = 97d1e8cfe4cf4d573fea2b5
    mock_create_storage_account.assert_called_with(
        '97d1e8cfe4cf4d573fea2b5', region='fake-region')
    self.assertIsInstance(disk_from_snapshot_uri, compute.AZComputeDisk)
    self.assertEqual(
        'fake_snapshot_name_f4c186ac_copy', disk_from_snapshot_uri.name)
    mock_create_disk.assert_called_with(
        azure_mocks.FAKE_SNAPSHOT.resource_group_name,
        'fake_snapshot_name_c4a46ad7_copy',
        mock.ANY)
Test that a disk can be created from a snapshot URI.
tests/providers/azure/internal/test_compute.py