test_tasks: Align test consistently with other using mocker
This commit is contained in:
parent
fe01d08cd9
commit
698be475e9
1 changed files with 5 additions and 6 deletions
|
@ -1,10 +1,8 @@
|
|||
# Copyright (C) 2019-2020 The Software Heritage developers
|
||||
# Copyright (C) 2019-2021 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
|
||||
|
||||
from unittest.mock import patch
|
||||
|
||||
from swh.lister.pattern import ListerStats
|
||||
|
||||
|
||||
|
@ -16,9 +14,10 @@ def test_ping(swh_scheduler_celery_app, swh_scheduler_celery_worker):
|
|||
assert res.result == "OK"
|
||||
|
||||
|
||||
@patch("swh.lister.pypi.tasks.PyPILister")
|
||||
def test_lister(lister, swh_scheduler_celery_app, swh_scheduler_celery_worker):
|
||||
# setup the mocked PypiLister
|
||||
def test_pypi_full_lister(
|
||||
swh_scheduler_celery_app, swh_scheduler_celery_worker, mocker
|
||||
):
|
||||
lister = mocker.patch("swh.lister.pypi.tasks.PyPILister")
|
||||
lister.from_configfile.return_value = lister
|
||||
lister.run.return_value = ListerStats(pages=1, origins=0)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue