'Test set worker when the job was started on another failed host.'

@mock.patch('cinder.db.worker_update', autospec=True)
@mock.patch('cinder.db.worker_get', autospec=True)
def test_set_worker_claim_from_another_host(self, mock_get, mock_update):

    service_id = mock.sentinel.service_id
    service.Service.service_id = service_id
    worker = mock.Mock(service_id=mock.sentinel.service_id2, status=mock.sentinel.status, cleaning=False, updated_at=mock.sentinel.updated_at)
    mock_get.return_value = worker
    backup = Backup(_context=self.context, status=mock.sentinel.status, id=mock.sentinel.id)
    backup.set_worker()
    mock_update.assert_called_once_with(self.context, worker.id, filters={'service_id': mock.sentinel.service_id2, 'status': mock.sentinel.status, 'race_preventer': worker.race_preventer, 'updated_at': mock.sentinel.updated_at}, service_id=service_id, status=mock.sentinel.status, orm_worker=worker)
    self.assertEqual(worker, backup.worker)
