diff --git a/swh/lister/pypi/tasks.py b/swh/lister/pypi/tasks.py index a763b43277e9602a49ecbe242038e8a8d26e71bd..ae83a44a6dd94c852f2719798b9dc9435424dcee 100644 --- a/swh/lister/pypi/tasks.py +++ b/swh/lister/pypi/tasks.py @@ -1,4 +1,4 @@ -# Copyright (C) 2018-2021 the Software Heritage developers +# Copyright (C) 2018-2023 the Software Heritage developers # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information @@ -8,9 +8,9 @@ from .lister import PyPILister @shared_task(name=f"{__name__}.PyPIListerTask") -def list_pypi(): +def list_pypi(**lister_args): "Full listing of the PyPI registry" - lister = PyPILister.from_configfile() + lister = PyPILister.from_configfile(**lister_args) return lister.run().dict() diff --git a/swh/lister/pypi/tests/test_tasks.py b/swh/lister/pypi/tests/test_tasks.py index f90fee22c431b41cbe8af3242e315c92fa92185b..564f3b7e248d88c7ec028970757db1c411aa90a7 100644 --- a/swh/lister/pypi/tests/test_tasks.py +++ b/swh/lister/pypi/tests/test_tasks.py @@ -1,4 +1,4 @@ -# Copyright (C) 2019-2021 The Software Heritage developers +# Copyright (C) 2019-2023 The Software Heritage developers # See the AUTHORS file at the top-level directory of this distribution # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information @@ -21,10 +21,13 @@ def test_pypi_full_lister( lister.from_configfile.return_value = lister lister.run.return_value = ListerStats(pages=1, origins=0) - res = swh_scheduler_celery_app.send_task("swh.lister.pypi.tasks.PyPIListerTask") + kwargs = dict(enable_origins=False) + res = swh_scheduler_celery_app.send_task( + "swh.lister.pypi.tasks.PyPIListerTask", kwargs=kwargs + ) assert res res.wait() assert res.successful() - lister.from_configfile.assert_called_once_with() + lister.from_configfile.assert_called_once_with(**kwargs) lister.run.assert_called_once_with()