Changeset View
Changeset View
Standalone View
Standalone View
swh/indexer/tests/test_origin_metadata.py
Show All 12 Lines | |||||
from swh.indexer.tests.test_utils import MockObjStorage, MockStorage | from swh.indexer.tests.test_utils import MockObjStorage, MockStorage | ||||
from swh.indexer.tests.test_utils import MockIndexerStorage | from swh.indexer.tests.test_utils import MockIndexerStorage | ||||
from swh.indexer.tests.test_origin_head import OriginHeadTestIndexer | from swh.indexer.tests.test_origin_head import OriginHeadTestIndexer | ||||
from swh.scheduler.tests.scheduler_testing import SchedulerTestFixture | from swh.scheduler.tests.scheduler_testing import SchedulerTestFixture | ||||
from swh.model.hashutil import hash_to_bytes | from swh.model.hashutil import hash_to_bytes | ||||
from .test_utils import BASE_TEST_CONFIG | |||||
class OriginMetadataTestIndexer(OriginMetadataIndexer): | class OriginMetadataTestIndexer(OriginMetadataIndexer): | ||||
def prepare(self): | def parse_config_file(self, *args, **kwargs): | ||||
self.config = { | return { | ||||
'storage': { | **BASE_TEST_CONFIG, | ||||
'cls': 'remote', | |||||
'args': { | |||||
'url': 'http://localhost:9999', | |||||
} | |||||
}, | |||||
'tools': [], | 'tools': [], | ||||
} | } | ||||
def prepare(self): | |||||
super().prepare() | |||||
self.storage = MockStorage() | self.storage = MockStorage() | ||||
self.idx_storage = MockIndexerStorage() | self.idx_storage = MockIndexerStorage() | ||||
self.log = logging.getLogger('swh.indexer') | |||||
self.objstorage = MockObjStorage() | self.objstorage = MockObjStorage() | ||||
self.tools = self.register_tools(self.config['tools']) | |||||
self.results = [] | |||||
class ContentMetadataTestIndexer(ContentMetadataIndexer): | class ContentMetadataTestIndexer(ContentMetadataIndexer): | ||||
"""Specific Metadata whose configuration is enough to satisfy the | """Specific Metadata whose configuration is enough to satisfy the | ||||
indexing tests. | indexing tests. | ||||
""" | """ | ||||
def prepare(self): | def prepare(self): | ||||
self.idx_storage = MockIndexerStorage() | self.idx_storage = MockIndexerStorage() | ||||
▲ Show 20 Lines • Show All 123 Lines • Show Last 20 Lines |