'init_host will clean an in-use volume stuck in uploading.'

@mock.patch('cinder.manager.CleanableManager.init_host')
def test_init_host_clears_uploads_in_use_volume(self, init_host_mock):

    volume = tests_utils.create_volume(self.context, status='uploading', size=0, host=CONF.host)
    db.worker_create(self.context, resource_type='Volume', resource_id=volume.id, status=volume.status, service_id=self.service_id)
    fake_uuid = fakes.get_fake_uuid()
    tests_utils.attach_volume(self.context, volume.id, fake_uuid, 'fake_host', '/dev/vda')
    self.volume.init_host(service_id=mock.sentinel.service_id)
    init_host_mock.assert_called_once_with(service_id=mock.sentinel.service_id, added_to_cluster=None)
    volume.refresh()
    self.assertEqual('in-use', volume.status)
    self._assert_workers_are_removed()
