  def testCreateVolumeCopy1(self,
                            mock_ec2_api,
                            mock_account,
                            mock_get_volume,
                            mock_snapshot,
                            mock_volume_type,
                            mock_loader):
    """Test that a volume is correctly cloned."""
    aws_mocks.FAKE_SNAPSHOT.name = aws_mocks.FAKE_VOLUME.volume_id
    mock_ec2_api.return_value.create_volume.return_value = aws_mocks.MOCK_CREATE_VOLUME
    mock_account.return_value = aws_mocks.MOCK_CALLER_IDENTITY
    mock_get_volume.return_value = aws_mocks.FAKE_VOLUME
    mock_snapshot.return_value = aws_mocks.FAKE_SNAPSHOT
    mock_volume_type.return_value = 'standard'
    mock_loader.return_value = None

    # CreateVolumeCopy(zone, volume_id='fake-volume-id'). This should grab
    # the volume 'fake-volume-id'.
    new_volume = forensics.CreateVolumeCopy(
        aws_mocks.FAKE_INSTANCE.availability_zone, volume_id=aws_mocks.FAKE_VOLUME.volume_id)
    mock_get_volume.assert_called_with('fake-volume-id')
    self.assertIsInstance(new_volume, ebs.AWSVolume)
    self.assertTrue(new_volume.name.startswith('evidence-'))
    self.assertIn('fake-volume-id', new_volume.name)
    self.assertTrue(new_volume.name.endswith('-copy'))
Test that a volume is correctly cloned.
tests/providers/aws/test_forensics.py