@pytest.mark.parametrize('doi', ['10.5281/zenodo.3761586'])
@pytest.mark.integration
@pytest.mark.service
def test_dataset_project_lock(doi, svc_client_with_repo):
    'Test dataset project lock.'
    (svc_client, headers, project_id, url_components) = svc_client_with_repo
    user = {'user_id': headers['Renku-User-Id']}
    payload = {'project_id': project_id, 'dataset_uri': doi}
    response = svc_client.post('/datasets.import', data=json.dumps(payload), headers=headers)
    assert response
    assert_rpc_response(response)
    assert ({'job_id', 'created_at'} == set(response.json['result'].keys()))
    dest = make_project_path(user, {'owner': url_components.owner, 'name': url_components.name})
    old_commit = Repo(dest).head.commit
    cache_project_cleanup()
    new_commit = Repo(dest).head.commit
    assert (old_commit.hexsha == new_commit.hexsha)
    assert (dest.exists() and [file for file in dest.glob('*')])
Test dataset project lock.
@pytest.mark.parametrize('doi', ['10.5281/zenodo.3761586'])
@pytest.mark.integration
@pytest.mark.service
def test_dataset_project_lock(doi, svc_client_with_repo):
    
    (svc_client, headers, project_id, url_components) = svc_client_with_repo
    user = {'user_id': headers['Renku-User-Id']}
    payload = {'project_id': project_id, 'dataset_uri': doi}
    response = svc_client.post('/datasets.import', data=json.dumps(payload), headers=headers)
    assert response
    assert_rpc_response(response)
    assert ({'job_id', 'created_at'} == set(response.json['result'].keys()))
    dest = make_project_path(user, {'owner': url_components.owner, 'name': url_components.name})
    old_commit = Repo(dest).head.commit
    cache_project_cleanup()
    new_commit = Repo(dest).head.commit
    assert (old_commit.hexsha == new_commit.hexsha)
    assert (dest.exists() and [file for file in dest.glob('*')])