Changeset View
Changeset View
Standalone View
Standalone View
swh/web/tests/api/views/test_snapshot.py
Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | while branches_offset < len(snapshot_branches): | ||||
expected_data['next_branch'] = next_branch | expected_data['next_branch'] = next_branch | ||||
else: | else: | ||||
expected_data['next_branch'] = None | expected_data['next_branch'] = None | ||||
assert rv.data == expected_data | assert rv.data == expected_data | ||||
whole_snapshot['branches'].update(expected_data['branches']) | whole_snapshot['branches'].update(expected_data['branches']) | ||||
if branches_offset < len(snapshot_branches): | if branches_offset < len(snapshot_branches): | ||||
next_url = reverse( | next_url = rv.wsgi_request.build_absolute_uri( | ||||
'api-1-snapshot', | reverse('api-1-snapshot', | ||||
url_args={'snapshot_id': snapshot}, | url_args={'snapshot_id': snapshot}, | ||||
query_params={'branches_from': next_branch, | query_params={'branches_from': next_branch, | ||||
'branches_count': branches_count}) | 'branches_count': branches_count})) | ||||
assert rv['Link'] == '<%s>; rel="next"' % next_url | assert rv['Link'] == '<%s>; rel="next"' % next_url | ||||
else: | else: | ||||
assert not rv.has_header('Link') | assert not rv.has_header('Link') | ||||
url = reverse('api-1-snapshot', | url = reverse('api-1-snapshot', | ||||
url_args={'snapshot_id': snapshot}) | url_args={'snapshot_id': snapshot}) | ||||
rv = api_client.get(url) | rv = api_client.get(url) | ||||
▲ Show 20 Lines • Show All 107 Lines • Show Last 20 Lines |