client = <django.test.client.Client object at 0x7f53fa737668>
archive_data = <swh.web.tests.conftest._ArchiveData object at 0x7f53fa737ba8>
origin_with_multiple_visits = {'archives': ['highlightjs-line-numbers.js.zip', 'highlightjs-line-numbers.js_visit2.zip'], 'id': b'MZ\xc0H_lE[d\xcc\x...s://doi.org/10.5063/schema/codemeta-2.0', 'description': 'Line numbering plugin for Highlight.js'}, 'type': 'git', ...}
def test_directory_origin_snapshot_revision_browse(
client, archive_data, origin_with_multiple_visits
):
origin_url = origin_with_multiple_visits["url"]
visits = archive_data.origin_visit_get(origin_url)
visit = random.choice(visits)
snapshot = archive_data.snapshot_get(visit["snapshot"])
branches, releases, _ = process_snapshot_branches(snapshot)
branch_info = random.choice(branches)
directory = archive_data.revision_get(branch_info["revision"])["directory"]
directory_content = archive_data.directory_ls(directory)
directory_subdir = random.choice(
> [e for e in directory_content if e["type"] == "dir"]
)
.tox/py3/lib/python3.7/site-packages/swh/web/tests/browse/views/test_directory.py:344:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <random.Random object at 0xe23888>, seq = []
def choice(self, seq):
"""Choose a random element from a non-empty sequence."""
try:
i = self._randbelow(len(seq))
except ValueError:
> raise IndexError('Cannot choose from an empty sequence') from None
E IndexError: Cannot choose from an empty sequence
/usr/lib/python3.7/random.py:261: IndexError
TEST RESULT
TEST RESULT
- Run At
- Oct 14 2021, 4:09 PM