lister.gnu.tests: Clarify lister configuration

This commit is contained in:
Antoine R. Dumont (@ardumont) 2020-10-29 17:54:01 +01:00
parent 20a91482ca
commit 36bc51cec5
No known key found for this signature in database
GPG key ID: 52E2E9840D10C3B8
2 changed files with 29 additions and 11 deletions

View file

@ -0,0 +1,26 @@
# Copyright (C) 2019-2020 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
@pytest.fixture
def lister_under_test():
return "gnu"
@pytest.fixture
def lister_gnu(swh_lister):
for task_type in [
{
"type": "load-archive-files",
"description": "Load archive repository",
"backend_name": "swh.loader.packages.tasks.LoadArchive",
"default_interval": "1 day",
},
]:
swh_lister.scheduler.create_task_type(task_type)
return swh_lister

View file

@ -5,21 +5,13 @@
import logging
import pytest
logger = logging.getLogger(__name__)
@pytest.fixture
def lister_under_test():
return "gnu"
def test_gnu_lister(lister_gnu, requests_mock_datadir):
lister_gnu.run()
@pytest.fixture
def test_gnu_lister(swh_lister, requests_mock_datadir):
swh_lister.run()
r = swh_lister.scheduler.search_tasks(task_type="load-archive-files")
r = lister_gnu.scheduler.search_tasks(task_type="load-archive-files")
assert len(r) == 383
for row in r: