Changeset View
Changeset View
Standalone View
Standalone View
swh/lister/cgit/tests/test_lister.py
Show First 20 Lines • Show All 259 Lines • ▼ Show 20 Lines | with open(os.path.join(datadir, "https_git.tizen/cgit,ofs=50"), "rb") as page: | ||||
mocker.patch.object(lister_cgit._get_and_parse.retry, "sleep") | mocker.patch.object(lister_cgit._get_and_parse.retry, "sleep") | ||||
repos: List[List[str]] = list(lister_cgit.get_pages()) | repos: List[List[str]] = list(lister_cgit.get_pages()) | ||||
flattened_repos = sum(repos, []) | flattened_repos = sum(repos, []) | ||||
# we should have 16 repos (listed on 3 pages) | # we should have 16 repos (listed on 3 pages) | ||||
assert len(repos) == 3 | assert len(repos) == 3 | ||||
assert len(flattened_repos) == 16 | assert len(flattened_repos) == 16 | ||||
def test_lister_cgit_summary_not_default(requests_mock_datadir, swh_scheduler): | |||||
"""cgit lister returns git url when the default repository tab is not the summary""" | |||||
url = "https://git.acdw.net/cgit" | |||||
lister_cgit = CGitLister(swh_scheduler, url=url) | |||||
stats = lister_cgit.run() | |||||
expected_nb_origins = 1 | |||||
assert stats == ListerStats(pages=1, origins=expected_nb_origins) |