Changeset View
Changeset View
Standalone View
Standalone View
swh/indexer/tests/test_fossology_license.py
Show First 20 Lines • Show All 72 Lines • ▼ Show 20 Lines | def parse_config_file(self, *args, **kwargs): | ||||
'name': 'nomos', | 'name': 'nomos', | ||||
'version': '3.1.0rc2-31-ga2cbb8c', | 'version': '3.1.0rc2-31-ga2cbb8c', | ||||
'configuration': { | 'configuration': { | ||||
'command_line': 'nomossa <filepath>', | 'command_line': 'nomossa <filepath>', | ||||
}, | }, | ||||
}, | }, | ||||
} | } | ||||
def prepare(self): | |||||
super().prepare() | |||||
self.idx_storage = BasicMockIndexerStorage() | |||||
self.log = logging.getLogger('swh.indexer') | |||||
self.objstorage = MockObjStorage() | |||||
class TestFossologyLicenseIndexer(CommonContentIndexerTest, unittest.TestCase): | class TestFossologyLicenseIndexer(CommonContentIndexerTest, unittest.TestCase): | ||||
"""Language indexer test scenarios: | """Language indexer test scenarios: | ||||
- Known sha1s in the input list have their data indexed | - Known sha1s in the input list have their data indexed | ||||
- Unknown sha1 in the input list are not indexed | - Unknown sha1 in the input list are not indexed | ||||
""" | """ | ||||
def get_indexer_results(self, ids): | |||||
yield from self.idx_storage.content_ctags_get(ids) | |||||
def setUp(self): | def setUp(self): | ||||
self.indexer = FossologyLicenseTestIndexer() | self.indexer = FossologyLicenseTestIndexer() | ||||
self.idx_storage = self.indexer.idx_storage | |||||
self.id0 = '01c9379dfc33803963d07c1ccc748d3fe4c96bb5' | self.id0 = '01c9379dfc33803963d07c1ccc748d3fe4c96bb5' | ||||
self.id1 = '688a5ef812c53907562fe379d4b3851e69c7cb15' | self.id1 = '688a5ef812c53907562fe379d4b3851e69c7cb15' | ||||
self.id2 = 'da39a3ee5e6b4b0d3255bfef95601890afd80709' # empty content | self.id2 = 'da39a3ee5e6b4b0d3255bfef95601890afd80709' # empty content | ||||
tool_id = self.indexer.tool['id'] | tool_id = self.indexer.tool['id'] | ||||
# then | # then | ||||
self.expected_results = { | self.expected_results = { | ||||
self.id0: { | self.id0: { | ||||
▲ Show 20 Lines • Show All 102 Lines • Show Last 20 Lines |