Changeset View
Changeset View
Standalone View
Standalone View
swh/lister/tests/test_cli.py
Show All 13 Lines | |||||
def test_get_lister_wrong_input(): | def test_get_lister_wrong_input(): | ||||
"""Unsupported lister should raise""" | """Unsupported lister should raise""" | ||||
with pytest.raises(ValueError) as e: | with pytest.raises(ValueError) as e: | ||||
get_lister("unknown", "db-url") | get_lister("unknown", "db-url") | ||||
assert "Invalid lister" in str(e.value) | assert "Invalid lister" in str(e.value) | ||||
def test_get_lister(mock_get_scheduler): | def test_get_lister(): | ||||
"""Instantiating a supported lister should be ok | """Instantiating a supported lister should be ok | ||||
""" | """ | ||||
db_url = init_db().url() | db_url = init_db().url() | ||||
# exclude listers because they need special instantiation treatment unrelated to | # exclude listers because they need special instantiation treatment unrelated to | ||||
# this test (launchpad: network mock, gnu: scheduler load task) | # this test (launchpad: network mock, gnu: scheduler load task) | ||||
listers_to_instantiate = set(SUPPORTED_LISTERS) - {"launchpad", "gnu"} | listers_to_instantiate = set(SUPPORTED_LISTERS) - {"launchpad", "gnu"} | ||||
for lister_name in listers_to_instantiate: | for lister_name in listers_to_instantiate: | ||||
Show All 38 Lines |