Changeset View
Changeset View
Standalone View
Standalone View
swh/web/tests/api/views/test_identifiers.py
Show All 37 Lines | for obj_type_short, obj_type, obj_id in ( | ||||
url_args = {'query_string': 'sha1_git:%s' % obj_id} | url_args = {'query_string': 'sha1_git:%s' % obj_id} | ||||
elif obj_type == SNAPSHOT: | elif obj_type == SNAPSHOT: | ||||
url_args = {'snapshot_id': obj_id} | url_args = {'snapshot_id': obj_id} | ||||
else: | else: | ||||
url_args = {'sha1_git': obj_id} | url_args = {'sha1_git': obj_id} | ||||
browse_rev_url = reverse('browse-%s' % obj_type, | browse_rev_url = reverse('browse-%s' % obj_type, | ||||
url_args=url_args, | url_args=url_args, | ||||
query_params={'origin': origin['url']}) | query_params={'origin': origin['url']}, | ||||
request=resp.wsgi_request) | |||||
expected_result = { | expected_result = { | ||||
'browse_url': browse_rev_url, | 'browse_url': browse_rev_url, | ||||
'metadata': {'origin': origin['url']}, | 'metadata': {'origin': origin['url']}, | ||||
'namespace': 'swh', | 'namespace': 'swh', | ||||
'object_id': obj_id, | 'object_id': obj_id, | ||||
'object_type': obj_type, | 'object_type': obj_type, | ||||
'scheme_version': 1 | 'scheme_version': 1 | ||||
Show All 35 Lines |