@pytest.mark.parametrize('url', ['https://gist.github.com/jsam/d957f306ed0fe4ff018e902df6a1c8e3'])
@pytest.mark.integration
@pytest.mark.service
@flaky(max_runs=30, min_passes=1)
def test_dataset_add_remote_file(url, svc_client_with_repo):
    'Test dataset add a remote file.'
    (svc_client, headers, project_id, url_components) = svc_client_with_repo
    user = {'user_id': headers['Renku-User-Id']}
    payload = {'project_id': project_id, 'short_name': uuid.uuid4().hex, 'create_dataset': True, 'files': [{'file_url': url}]}
    response = svc_client.post('/datasets.add', data=json.dumps(payload), headers=headers)
    assert response
    assert_rpc_response(response)
    assert ({'files', 'short_name', 'project_id'} == set(response.json['result'].keys()))
    dest = make_project_path(user, {'owner': url_components.owner, 'name': url_components.name})
    old_commit = Repo(dest).head.commit
    job_id = response.json['result']['files'][0]['job_id']
    commit_message = 'service: dataset add remote file'
    dataset_add_remote_file(user, job_id, project_id, True, commit_message, payload['short_name'], url)
    new_commit = Repo(dest).head.commit
    assert (old_commit.hexsha != new_commit.hexsha)
    assert (commit_message == new_commit.message)
Test dataset add a remote file.
@pytest.mark.parametrize('url', ['https://gist.github.com/jsam/d957f306ed0fe4ff018e902df6a1c8e3'])
@pytest.mark.integration
@pytest.mark.service
@flaky(max_runs=30, min_passes=1)
def test_dataset_add_remote_file(url, 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, 'short_name': uuid.uuid4().hex, 'create_dataset': True, 'files': [{'file_url': url}]}
    response = svc_client.post('/datasets.add', data=json.dumps(payload), headers=headers)
    assert response
    assert_rpc_response(response)
    assert ({'files', 'short_name', 'project_id'} == set(response.json['result'].keys()))
    dest = make_project_path(user, {'owner': url_components.owner, 'name': url_components.name})
    old_commit = Repo(dest).head.commit
    job_id = response.json['result']['files'][0]['job_id']
    commit_message = 'service: dataset add remote file'
    dataset_add_remote_file(user, job_id, project_id, True, commit_message, payload['short_name'], url)
    new_commit = Repo(dest).head.commit
    assert (old_commit.hexsha != new_commit.hexsha)
    assert (commit_message == new_commit.message)