Page MenuHomeSoftware Heritage

Jenkins > .tox.py3.lib.python3.7.site-packages.swh.web.tests.common.test_identifiers::Tests / Python tests / test_resolve_swhids_snapshot_context
Failed

TEST RESULT

Run At
Mar 3 2021, 10:02 AM
Details
client = <django.test.client.Client object at 0x7fdbe2f9f390> archive_data = <swh.web.tests.conftest._ArchiveData object at 0x7fdbe4be9c18> @given(origin_with_multiple_visits()) > def test_resolve_swhids_snapshot_context(client, archive_data, origin): .tox/py3/lib/python3.7/site-packages/swh/web/tests/common/test_identifiers.py:463: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/py3/lib/python3.7/site-packages/swh/web/tests/common/test_identifiers.py:515: in test_resolve_swhids_snapshot_context _check_resolved_swhid_browse_url(ObjectType.REVISION, rev, snapshot_context) .tox/py3/lib/python3.7/site-packages/swh/web/tests/common/test_identifiers.py:616: in _check_resolved_swhid_browse_url obj_swhid_resolved = resolve_swhid(obj_swhid) .tox/py3/lib/python3.7/site-packages/swh/web/common/identifiers.py:170: in resolve_swhid hash_to_hex(swhid_parsed.anchor.object_id), _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ snapshot_id = 'da8abf3ec5203afa1561754a041aca64d7580ec2' revision_id = '3bd01955e961aa2e6e1b6f9cd9e003f94273584e' def lookup_snapshot_branch_name_from_tip_revision( snapshot_id: str, revision_id: str ) -> Optional[str]: """Check if a revision corresponds to the tip of a snapshot branch Args: snapshot_id: hexadecimal representation of a snapshot id revision_id: hexadecimal representation of a revision id Returns: The name of the first found branch or None otherwise """ per_page = 10000 branches_from = "" snapshot: Dict[str, Any] = {"branches": {}} branches = [] while not branches_from or len(snapshot["branches"]) == per_page + 1: snapshot = lookup_snapshot( snapshot_id, target_types=[ObjectType.REVISION], branches_from=branches_from, branches_count=per_page + 1, ) branches += [ {"name": k, "target": v["target"]} for k, v in snapshot["branches"].items() ] > branches_from = branches[-1]["name"] E IndexError: list index out of range .tox/py3/lib/python3.7/site-packages/swh/web/common/archive.py:1126: IndexError