Changeset View
Changeset View
Standalone View
Standalone View
swh/lister/core/tests/test_lister.py
# Copyright (C) 2019 the Software Heritage developers | # Copyright (C) 2019 the Software Heritage developers | ||||
# License: GNU General Public License version 3, or any later version | # License: GNU General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
import abc | import abc | ||||
import datetime | import datetime | ||||
import time | import time | ||||
from unittest import TestCase | from unittest import TestCase | ||||
from unittest.mock import Mock, patch | from unittest.mock import Mock, patch | ||||
import requests_mock | import requests_mock | ||||
from sqlalchemy import create_engine | from sqlalchemy import create_engine | ||||
from typing import Any, Callable, Optional, Pattern, Type, Union | from typing import Any, Callable, Optional, Pattern, Type, Union | ||||
import swh.lister | |||||
from swh.lister.core.abstractattribute import AbstractAttribute | from swh.lister.core.abstractattribute import AbstractAttribute | ||||
from swh.lister.tests.test_utils import init_db | from swh.lister.tests.test_utils import init_db | ||||
def noop(*args, **kwargs): | def noop(*args, **kwargs): | ||||
pass | pass | ||||
def test_version_generation(): | |||||
assert swh.lister.__version__ != 'devel', \ | |||||
"Make sure swh.lister is installed (e.g. pip install -e .)" | |||||
class HttpListerTesterBase(abc.ABC): | class HttpListerTesterBase(abc.ABC): | ||||
"""Testing base class for listers. | """Testing base class for listers. | ||||
This contains methods for both :class:`HttpSimpleListerTester` and | This contains methods for both :class:`HttpSimpleListerTester` and | ||||
:class:`HttpListerTester`. | :class:`HttpListerTester`. | ||||
See :class:`swh.lister.gitlab.tests.test_lister` for an example of how | See :class:`swh.lister.gitlab.tests.test_lister` for an example of how | ||||
to customize for a specific listing service. | to customize for a specific listing service. | ||||
▲ Show 20 Lines • Show All 397 Lines • Show Last 20 Lines |