lister.tests: Add missing task_type for package listers
The scheduler module no longer initializes itself those task_type.
This commit is contained in:
parent
5191d291da
commit
1cf7c8e86b
10 changed files with 104 additions and 22 deletions
|
@ -1 +1,23 @@
|
|||
# Copyright (C) 2019 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
|
||||
|
||||
import pytest
|
||||
|
||||
from swh.lister.core.tests.conftest import * # noqa
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def lister_pypi(swh_listers):
|
||||
lister = swh_listers['pypi']
|
||||
|
||||
# Add the load-deb-package in the scheduler backend
|
||||
lister.scheduler.create_task_type({
|
||||
'type': 'load-pypi',
|
||||
'description': 'Load PyPI package',
|
||||
'backend_name': 'swh.loader.package.tasks.LoadPyPI',
|
||||
'default_interval': '1 day',
|
||||
})
|
||||
|
||||
return lister
|
||||
|
|
|
@ -4,12 +4,10 @@
|
|||
# See top-level LICENSE file for more information
|
||||
|
||||
|
||||
def test_pypi_lister(swh_listers, requests_mock_datadir):
|
||||
lister = swh_listers['pypi']
|
||||
def test_pypi_lister(lister_pypi, requests_mock_datadir):
|
||||
lister_pypi.run()
|
||||
|
||||
lister.run()
|
||||
|
||||
r = lister.scheduler.search_tasks(task_type='load-pypi')
|
||||
r = lister_pypi.scheduler.search_tasks(task_type='load-pypi')
|
||||
assert len(r) == 4
|
||||
|
||||
for row in r:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue