lister.gitlab.tests: Clarify lister configuration

This commit is contained in:
Antoine R. Dumont (@ardumont) 2020-10-29 17:50:08 +01:00
parent 978fbbe029
commit 20a91482ca
No known key found for this signature in database
GPG key ID: 52E2E9840D10C3B8
2 changed files with 29 additions and 3 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 "gitlab"
@pytest.fixture
def lister_gitlab(swh_lister):
for task_type in [
{
"type": "load-git",
"description": "Load git repository",
"backend_name": "swh.loader.git.tasks.UpdateGitRepository",
"default_interval": "1 day",
},
]:
swh_lister.scheduler.create_task_type(task_type)
return swh_lister

View file

@ -49,10 +49,10 @@ def lister_under_test():
return "gitlab"
def test_lister_gitlab(swh_lister, requests_mock_datadir):
swh_lister.run()
def test_lister_gitlab(lister_gitlab, requests_mock_datadir):
lister_gitlab.run()
r = swh_lister.scheduler.search_tasks(task_type="load-git")
r = lister_gitlab.scheduler.search_tasks(task_type="load-git")
assert len(r) == 10
for row in r: