'Test snapshot can be created and deleted.'

def test_delete_busy_snapshot(self):

    self.volume.driver.vg = fake_lvm.FakeBrickLVM('cinder-volumes', False, None, 'default')
    volume = tests_utils.create_volume(self.context, **self.volume_params)
    volume_id = volume['id']
    self.volume.create_volume(self.context, volume)
    snapshot = create_snapshot(volume_id, size=volume['size'])
    self.volume.create_snapshot(self.context, snapshot)
    with mock.patch.object(self.volume.driver, 'delete_snapshot', side_effect=exception.SnapshotIsBusy(snapshot_name='fake')) as mock_del_snap:
        snapshot_id = snapshot.id
        self.volume.delete_snapshot(self.context, snapshot)
        snapshot_ref = objects.Snapshot.get_by_id(self.context, snapshot_id)
        self.assertEqual(snapshot_id, snapshot_ref.id)
        self.assertEqual(fields.SnapshotStatus.AVAILABLE, snapshot_ref.status)
        mock_del_snap.assert_called_once_with(snapshot)
