Changeset View
Changeset View
Standalone View
Standalone View
swh/indexer/tests/test_utils.py
Show First 20 Lines • Show All 242 Lines • ▼ Show 20 Lines | def indexer_configuration_add(self, tools): | ||||
tool = tools[0] | tool = tools[0] | ||||
if tool['tool_name'] == 'swh-metadata-translator': | if tool['tool_name'] == 'swh-metadata-translator': | ||||
return [{ | return [{ | ||||
'id': 30, | 'id': 30, | ||||
'tool_name': 'swh-metadata-translator', | 'tool_name': 'swh-metadata-translator', | ||||
'tool_version': '0.0.1', | 'tool_version': '0.0.1', | ||||
'tool_configuration': { | 'tool_configuration': { | ||||
'type': 'local', | 'type': 'local', | ||||
'context': 'npm' | 'context': 'NpmMapping' | ||||
}, | }, | ||||
}] | }] | ||||
elif tool['tool_name'] == 'swh-metadata-detector': | elif tool['tool_name'] == 'swh-metadata-detector': | ||||
return [{ | return [{ | ||||
'id': 7, | 'id': 7, | ||||
'tool_name': 'swh-metadata-detector', | 'tool_name': 'swh-metadata-detector', | ||||
'tool_version': '0.0.1', | 'tool_version': '0.0.1', | ||||
'tool_configuration': { | 'tool_configuration': { | ||||
'type': 'local', | 'type': 'local', | ||||
'context': 'npm' | 'context': 'NpmMapping' | ||||
}, | }, | ||||
}] | }] | ||||
elif tool['tool_name'] == 'origin-metadata': | elif tool['tool_name'] == 'origin-metadata': | ||||
return [{ | return [{ | ||||
'id': 8, | 'id': 8, | ||||
'tool_name': 'origin-metadata', | 'tool_name': 'origin-metadata', | ||||
'tool_version': '0.0.1', | 'tool_version': '0.0.1', | ||||
'tool_configuration': {}, | 'tool_configuration': {}, | ||||
Show All 16 Lines | def origin_intrinsic_metadata_add(self, metadata, conflict_update=None): | ||||
self.added_data.append( | self.added_data.append( | ||||
('origin_intrinsic_metadata', conflict_update, metadata)) | ('origin_intrinsic_metadata', conflict_update, metadata)) | ||||
def content_metadata_get(self, sha1s): | def content_metadata_get(self, sha1s): | ||||
return [{ | return [{ | ||||
'tool': { | 'tool': { | ||||
'configuration': { | 'configuration': { | ||||
'type': 'local', | 'type': 'local', | ||||
'context': 'npm' | 'context': 'NpmMapping' | ||||
}, | }, | ||||
'version': '0.0.1', | 'version': '0.0.1', | ||||
'id': 6, | 'id': 6, | ||||
'name': 'swh-metadata-translator' | 'name': 'swh-metadata-translator' | ||||
}, | }, | ||||
'id': b'cde', | 'id': b'cde', | ||||
'translated_metadata': { | 'translated_metadata': { | ||||
'issueTracker': { | 'issueTracker': { | ||||
▲ Show 20 Lines • Show All 107 Lines • Show Last 20 Lines |