Changeset View
Changeset View
Standalone View
Standalone View
swh/lister/github/tests/test_lister.py
Show First 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | def test_lister_github(swh_listers, requests_mock_datadir): | ||||
r = lister.scheduler.search_tasks(task_type='load-git') | r = lister.scheduler.search_tasks(task_type='load-git') | ||||
assert len(r) == 100 | assert len(r) == 100 | ||||
for row in r: | for row in r: | ||||
assert row['type'] == 'load-git' | assert row['type'] == 'load-git' | ||||
# arguments check | # arguments check | ||||
args = row['arguments']['args'] | args = row['arguments']['args'] | ||||
assert len(args) == 1 | assert len(args) == 0 | ||||
url = args[0] | |||||
assert url.startswith('https://github.com') | |||||
# kwargs | # kwargs | ||||
kwargs = row['arguments']['kwargs'] | kwargs = row['arguments']['kwargs'] | ||||
assert kwargs == {} | url = kwargs['url'] | ||||
assert url.startswith('https://github.com') | |||||
assert row['policy'] == 'recurring' | assert row['policy'] == 'recurring' | ||||
assert row['priority'] is None | assert row['priority'] is None |