  def testCreateDiskCopy3(self,
                          mock_list_instances,
                          mock_list_disk,
                          mock_list_subscription_ids,
                          mock_credentials,
                          mock_resource_group,
                          mock_disk_type,
                          mock_provider):
    """Test that a disk copy is correctly created.

    The first call should raise a RuntimeError in GetInstance as we are
    querying a non-existent instance. The second call should raise a
    RuntimeError in GetDisk as we are querying a non-existent disk."""
    mock_provider.return_value = azure_mocks.MOCK_CAPACITY_PROVIDER
    mock_list_instances.return_value = {}
    mock_list_disk.return_value = {}
    mock_list_subscription_ids.return_value = ['fake-subscription-id']
    mock_credentials.return_value = ('fake-subscription-id', mock.Mock())
    mock_resource_group.return_value = 'fake-resource-group'
    mock_disk_type.return_value = 'fake-disk-type'

    with self.assertRaises(errors.ResourceCreationError) as error:
      forensics.CreateDiskCopy(
          azure_mocks.FAKE_ACCOUNT.default_resource_group_name,
          instance_name='non-existent-vm-name',
          region='fake-region')
    self.assertEqual(
        'Cannot copy disk "None": Instance non-existent-vm-name was not found '
        'in subscription fake-subscription-id', str(error.exception))

    with self.assertRaises(errors.ResourceCreationError) as error:
      forensics.CreateDiskCopy(
          azure_mocks.FAKE_ACCOUNT.default_resource_group_name,
          disk_name='non-existent-disk-name',
          region='fake-region')
    self.assertEqual(
        'Cannot copy disk "non-existent-disk-name": Disk non-existent-disk-name'
        ' was not found in subscription fake-subscription-id',
        str(error.exception))
Test that a disk copy is correctly created.

The first call should raise a RuntimeError in GetInstance as we are
querying a non-existent instance. The second call should raise a
RuntimeError in GetDisk as we are querying a non-existent disk.
tests/providers/azure/test_forensics.py