  def testCreateDiskFromSnapshot(self, mock_create_disk, mock_provider):
    """Test that a disk can be created from a snapshot."""
    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
    # CreateDiskFromSnapshot(
    #     snapshot=FAKE_SNAPSHOT, disk_name=None, disk_name_prefix='')
    disk_from_snapshot = azure_mocks.FAKE_ACCOUNT.compute.CreateDiskFromSnapshot(
        azure_mocks.FAKE_SNAPSHOT)
    self.assertIsInstance(disk_from_snapshot, compute.AZComputeDisk)
    self.assertEqual(
        'fake_snapshot_name_f4c186ac_copy', disk_from_snapshot.name)
    mock_create_disk.assert_called_with(
        azure_mocks.FAKE_SNAPSHOT.resource_group_name,
        'fake_snapshot_name_c4a46ad7_copy',
        mock.ANY)

    # CreateDiskFromSnapshot(
    #     snapshot=FAKE_SNAPSHOT,
    #     disk_name='new-forensics-disk',
    #     disk_name_prefix='')
    azure_mocks.FAKE_ACCOUNT.compute.CreateDiskFromSnapshot(
        azure_mocks.FAKE_SNAPSHOT, disk_name='new-forensics-disk')
    mock_create_disk.assert_called_with(
        azure_mocks.FAKE_SNAPSHOT.resource_group_name,
        'new-forensics-disk',
        mock.ANY)

    # CreateDiskFromSnapshot(
    #     snapshot=FAKE_SNAPSHOT, disk_name=None, disk_name_prefix='prefix')
    azure_mocks.FAKE_ACCOUNT.compute.CreateDiskFromSnapshot(
        azure_mocks.FAKE_SNAPSHOT, disk_name_prefix='prefix')
    mock_create_disk.assert_called_with(
        azure_mocks.FAKE_SNAPSHOT.resource_group_name,
        'prefix_fake_snapshot_name_c4a46ad7_copy',
        mock.ANY)

    # CreateDiskFromSnapshot(
    #     snapshot=FAKE_SNAPSHOT, disk_type='StandardSSD_LRS')
    expected_args = {
        'location': 'fake-region',
        'creation_data': {
            'sourceResourceId': '/subscriptions/sub/resourceGroups/'
                                'fake-resource-group/providers/'
                                'Microsoft.Compute/type/fake_snapshot_name',
            'create_option': models.DiskCreateOption.copy
        },
        'sku': {
            'name': 'StandardSSD_LRS'
        }
    }
    azure_mocks.FAKE_ACCOUNT.compute.CreateDiskFromSnapshot(
        azure_mocks.FAKE_SNAPSHOT, disk_type='StandardSSD_LRS')
    mock_create_disk.assert_called_with(
        azure_mocks.FAKE_SNAPSHOT.resource_group_name,
        'fake_snapshot_name_c4a46ad7_copy',
        expected_args)
Test that a disk can be created from a snapshot.
tests/providers/azure/internal/test_compute.py