'Test that init_host will delete a snapshot stuck in deleting.'

def test_init_host_clears_deleting_snapshots(self):

    volume = tests_utils.create_volume(self.context, status='deleting', size=1, host=CONF.host)
    snapshot = tests_utils.create_snapshot(self.context, volume.id, status='deleting')
    db.worker_create(self.context, resource_type='Volume', resource_id=volume.id, status=volume.status, service_id=self.service_id)
    self.volume.init_host(service_id=self.service_id)
    self.assertRaises(exception.VolumeNotFound, volume.refresh)
    self.assertRaises(exception.SnapshotNotFound, snapshot.refresh)
