Changeset View
Changeset View
Standalone View
Standalone View
swh/indexer/tests/test_mimetype.py
Show All 26 Lines | |||||
class MimetypeTestIndexer(ContentMimetypeIndexer): | class MimetypeTestIndexer(ContentMimetypeIndexer): | ||||
"""Specific mimetype whose configuration is enough to satisfy the | """Specific mimetype whose configuration is enough to satisfy the | ||||
indexing tests. | indexing tests. | ||||
""" | """ | ||||
def prepare(self): | def prepare(self): | ||||
self.config = { | self.config = { | ||||
'destination_task': None, | |||||
'tools': { | 'tools': { | ||||
'name': 'file', | 'name': 'file', | ||||
'version': '1:5.30-1+deb9u1', | 'version': '1:5.30-1+deb9u1', | ||||
'configuration': { | 'configuration': { | ||||
"type": "library", | "type": "library", | ||||
"debian-package": "python3-magic" | "debian-package": "python3-magic" | ||||
}, | }, | ||||
}, | }, | ||||
} | } | ||||
self.idx_storage = _MockIndexerStorage() | self.idx_storage = _MockIndexerStorage() | ||||
self.log = logging.getLogger('swh.indexer') | self.log = logging.getLogger('swh.indexer') | ||||
self.objstorage = MockObjStorage() | self.objstorage = MockObjStorage() | ||||
self.destination_task = self.config['destination_task'] | |||||
self.tools = self.register_tools(self.config['tools']) | self.tools = self.register_tools(self.config['tools']) | ||||
self.tool = self.tools[0] | self.tool = self.tools[0] | ||||
class MimetypeIndexerUnknownToolTestStorage(MimetypeTestIndexer): | class MimetypeIndexerUnknownToolTestStorage(MimetypeTestIndexer): | ||||
"""Specific mimetype whose configuration is not enough to satisfy the | """Specific mimetype whose configuration is not enough to satisfy the | ||||
indexing tests. | indexing tests. | ||||
▲ Show 20 Lines • Show All 94 Lines • Show Last 20 Lines |