Changeset View
Changeset View
Standalone View
Standalone View
swh/web/tests/browse/views/test_origin.py
Show First 20 Lines • Show All 666 Lines • ▼ Show 20 Lines | def test_origin_release_browse(client, archive_data, origin): | ||||
assert resp.status_code == 200 | assert resp.status_code == 200 | ||||
assert_contains(resp, release_data["name"]) | assert_contains(resp, release_data["name"]) | ||||
assert_contains(resp, release["target"]) | assert_contains(resp, release["target"]) | ||||
swhid_context = { | swhid_context = { | ||||
"origin": origin["url"], | "origin": origin["url"], | ||||
"visit": get_swh_persistent_id(SNAPSHOT, snapshot["id"]), | "visit": get_swh_persistent_id(SNAPSHOT, snapshot["id"]), | ||||
"anchor": get_swh_persistent_id(RELEASE, release_data["id"]), | "anchor": get_swh_persistent_id(RELEASE, release_data["id"]), | ||||
"path": f"/", | "path": "/", | ||||
} | } | ||||
swh_dir_id = get_swh_persistent_id( | swh_dir_id = get_swh_persistent_id( | ||||
DIRECTORY, revision_data["directory"], metadata=swhid_context | DIRECTORY, revision_data["directory"], metadata=swhid_context | ||||
) | ) | ||||
swh_dir_id_url = reverse("browse-swh-id", url_args={"swh_id": swh_dir_id}) | swh_dir_id_url = reverse("browse-swh-id", url_args={"swh_id": swh_dir_id}) | ||||
assert_contains(resp, swh_dir_id) | assert_contains(resp, swh_dir_id) | ||||
assert_contains(resp, swh_dir_id_url) | assert_contains(resp, swh_dir_id_url) | ||||
▲ Show 20 Lines • Show All 525 Lines • Show Last 20 Lines |