Changeset View
Changeset View
Standalone View
Standalone View
swh/lister/tests/test_cli.py
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | listers = { | ||||
"cgit": "https://some.where/cgit", | "cgit": "https://some.where/cgit", | ||||
} | } | ||||
# check the override ends up defined in the lister | # check the override ends up defined in the lister | ||||
for lister_name, url in listers.items(): | for lister_name, url in listers.items(): | ||||
lst = get_lister( | lst = get_lister( | ||||
lister_name, | lister_name, | ||||
db_url, | db_url, | ||||
**{"url": url, "priority": "high", "policy": "oneshot",} | **{"url": url, "priority": "high", "policy": "oneshot",}, | ||||
) | ) | ||||
assert lst.url == url | assert lst.url == url | ||||
assert lst.config["priority"] == "high" | assert lst.config["priority"] == "high" | ||||
assert lst.config["policy"] == "oneshot" | assert lst.config["policy"] == "oneshot" | ||||
# check the default urls are used and not the override (since it's not | # check the default urls are used and not the override (since it's not | ||||
# passed) | # passed) | ||||
for lister_name, url in listers.items(): | for lister_name, url in listers.items(): | ||||
lst = get_lister(lister_name, db_url) | lst = get_lister(lister_name, db_url) | ||||
# no override so this does not end up in lister's configuration | # no override so this does not end up in lister's configuration | ||||
assert "url" not in lst.config | assert "url" not in lst.config | ||||
assert "priority" not in lst.config | assert "priority" not in lst.config | ||||
assert "oneshot" not in lst.config | assert "oneshot" not in lst.config | ||||
assert lst.url == lst.DEFAULT_URL | assert lst.url == lst.DEFAULT_URL |