Changeset View
Changeset View
Standalone View
Standalone View
swh/indexer/tests/test_metadata.py
# Copyright (C) 2017-2018 The Software Heritage developers | # Copyright (C) 2017-2018 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# 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 unittest | import unittest | ||||
from swh.indexer.metadata_dictionary import CROSSWALK_TABLE, MAPPINGS | |||||
from swh.indexer.metadata_detector import detect_metadata | |||||
from swh.indexer.metadata_detector import extract_minimal_metadata_dict | |||||
from swh.indexer.metadata import ContentMetadataIndexer | |||||
from swh.indexer.metadata import RevisionMetadataIndexer | |||||
from swh.indexer.tests.test_utils import MockObjStorage, MockStorage | |||||
from swh.indexer.tests.test_utils import MockIndexerStorage | |||||
from swh.model.hashutil import hash_to_bytes | from swh.model.hashutil import hash_to_bytes | ||||
from .test_utils import BASE_TEST_CONFIG | from swh.indexer.metadata_dictionary import CROSSWALK_TABLE, MAPPINGS | ||||
from swh.indexer.metadata_detector import ( | |||||
detect_metadata, extract_minimal_metadata_dict | |||||
) | |||||
from swh.indexer.metadata import ( | |||||
ContentMetadataIndexer, RevisionMetadataIndexer | |||||
) | |||||
from .test_utils import ( | |||||
MockObjStorage, MockStorage, MockIndexerStorage, | |||||
BASE_TEST_CONFIG | |||||
) | |||||
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 parse_config_file(self, *args, **kwargs): | def parse_config_file(self, *args, **kwargs): | ||||
assert False, 'should not be called; the rev indexer configures it.' | assert False, 'should not be called; the rev indexer configures it.' | ||||
▲ Show 20 Lines • Show All 457 Lines • Show Last 20 Lines |