lister.tests: Avoid duplication setup step
And remove unnecessary fixture redefinition which causes indirection.
This commit is contained in:
parent
3ddfd00e90
commit
cb853f4898
5 changed files with 18 additions and 40 deletions
|
@ -3,21 +3,4 @@
|
|||
# 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_gnu(swh_listers):
|
||||
lister = swh_listers['gnu']
|
||||
|
||||
# Add the load-deb-package in the scheduler backend
|
||||
lister.scheduler.create_task_type({
|
||||
'type': 'load-archive-files',
|
||||
'description': 'Load archive files.',
|
||||
'backend_name': 'swh.loader.package.tasks.LoadArchive',
|
||||
'default_interval': '1 day',
|
||||
})
|
||||
|
||||
return lister
|
||||
|
|
|
@ -9,10 +9,12 @@ import logging
|
|||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def test_gnu_lister(lister_gnu, requests_mock_datadir):
|
||||
lister_gnu.run()
|
||||
def test_gnu_lister(swh_listers, requests_mock_datadir):
|
||||
lister = swh_listers['gnu']
|
||||
|
||||
r = lister_gnu.scheduler.search_tasks(task_type='load-archive-files')
|
||||
lister.run()
|
||||
|
||||
r = lister.scheduler.search_tasks(task_type='load-archive-files')
|
||||
assert len(r) == 383
|
||||
|
||||
for row in r:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue