lister.gitea.tests: Clarify lister configuration
This commit is contained in:
parent
47ccce3817
commit
def0eb5060
2 changed files with 29 additions and 12 deletions
26
swh/lister/gitea/tests/conftest.py
Normal file
26
swh/lister/gitea/tests/conftest.py
Normal 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 "gitea"
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def lister_gitea(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
|
|
@ -7,8 +7,6 @@ import logging
|
|||
import re
|
||||
import unittest
|
||||
|
||||
import pytest
|
||||
|
||||
from swh.lister.core.tests.test_lister import HttpListerTesterBase
|
||||
from swh.lister.gitea.lister import GiteaLister
|
||||
|
||||
|
@ -40,16 +38,9 @@ class GiteaListerTester(HttpListerTesterBase, unittest.TestCase):
|
|||
return headers
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def lister_under_test():
|
||||
return "gitea"
|
||||
|
||||
|
||||
def test_lister_gitea(swh_lister, requests_mock_datadir):
|
||||
lister: GiteaLister = swh_lister
|
||||
|
||||
lister.run()
|
||||
r = lister.scheduler.search_tasks(task_type="load-git")
|
||||
def test_lister_gitea(lister_gitea, requests_mock_datadir):
|
||||
lister_gitea.run()
|
||||
r = lister_gitea.scheduler.search_tasks(task_type="load-git")
|
||||
assert len(r) == 3
|
||||
|
||||
for row in r:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue