Port cgit lister to the new lister api

Related to T2984
This commit is contained in:
Vincent SELLIER 2021-01-22 15:39:49 +01:00
parent 59c9abb916
commit e4a590fc7f
No known key found for this signature in database
GPG key ID: 3F13C434EADAD17D
8 changed files with 121 additions and 213 deletions

View file

@ -39,35 +39,3 @@ def test_get_lister(swh_scheduler_config):
**lister_args.get(lister_name, {}),
)
assert hasattr(lst, "run")
def test_get_lister_override():
"""Overriding the lister configuration should populate its config
"""
db_url = init_db().url()
listers = {
"cgit": "https://some.where/cgit",
}
# check the override ends up defined in the lister
for lister_name, url in listers.items():
lst = get_lister(
lister_name, db_url, url=url, priority="high", policy="oneshot"
)
assert lst.url == url
assert lst.config["priority"] == "high"
assert lst.config["policy"] == "oneshot"
# check the default urls are used and not the override (since it's not
# passed)
for lister_name, url in listers.items():
lst = get_lister(lister_name, db_url)
# no override so this does not end up in lister's configuration
assert "url" not in lst.config
assert "priority" not in lst.config
assert "oneshot" not in lst.config
assert lst.url == lst.DEFAULT_URL