Changeset View
Changeset View
Standalone View
Standalone View
swh/web/tests/browse/views/test_origin.py
Show First 20 Lines • Show All 488 Lines • ▼ Show 20 Lines | mock_utils_service.lookup_origin.return_value = { | ||||
'id': 457, | 'id': 457, | ||||
'url': 'https://github.com/foo/bar' | 'url': 'https://github.com/foo/bar' | ||||
} | } | ||||
url = reverse('browse-origin-directory', | url = reverse('browse-origin-directory', | ||||
url_args={'origin_url': 'bar'}) | url_args={'origin_url': 'bar'}) | ||||
resp = client.get(url) | resp = client.get(url) | ||||
assert resp.status_code == 200 | assert resp.status_code == 200 | ||||
assert_template_used(resp, 'browse/directory.html') | assert_template_used(resp, 'browse/directory.html') | ||||
assert re.search('snapshot.*is empty', resp.content.decode('utf-8')) | resp_content = resp.content.decode('utf-8') | ||||
assert re.search('snapshot.*is empty', resp_content) | |||||
assert not re.search('swh-tr-link', resp_content) | |||||
@given(origin_with_releases()) | @given(origin_with_releases()) | ||||
def test_origin_release_browse(client, archive_data, origin): | def test_origin_release_browse(client, archive_data, origin): | ||||
# for swh.web.browse.utils.get_snapshot_content to only return one branch | # for swh.web.browse.utils.get_snapshot_content to only return one branch | ||||
snapshot_max_size = swh.web.browse.utils.snapshot_content_max_size | snapshot_max_size = swh.web.browse.utils.snapshot_content_max_size | ||||
swh.web.browse.utils.snapshot_content_max_size = 1 | swh.web.browse.utils.snapshot_content_max_size = 1 | ||||
try: | try: | ||||
▲ Show 20 Lines • Show All 395 Lines • Show Last 20 Lines |