Changeset View
Changeset View
Standalone View
Standalone View
swh/indexer/tests/test_utils.py
Show First 20 Lines • Show All 136 Lines • ▼ Show 20 Lines | def indexer_configuration_add(self, tools): | ||||
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': 'npm' | ||||
}, | }, | ||||
}] | }] | ||||
zack: should be updated according to the name change suggested above | |||||
elif tool['tool_name'] == 'swh-head-revision': | |||||
return [{ | |||||
'id': 7, | |||||
moraneggUnsubmitted Done Inline Actionsyou should probably use a different id (even if this is a mock storage) moranegg: you should probably use a different id (even if this is a mock storage) | |||||
'tool_name': 'swh-head-revision', | |||||
'tool_version': '0.0.1', | |||||
'tool_configuration': {}, | |||||
}] | |||||
else: | |||||
assert False, 'Unknown tool {tool_name}'.format(**tool) | |||||
def content_metadata_missing(self, sha1s): | def content_metadata_missing(self, sha1s): | ||||
yield from [] | yield from [] | ||||
def content_metadata_add(self, metadata, conflict_update=None): | def content_metadata_add(self, metadata, conflict_update=None): | ||||
self.state = metadata | self.state = metadata | ||||
self.conflict_update = conflict_update | self.conflict_update = conflict_update | ||||
def revision_metadata_add(self, metadata, conflict_update=None): | def revision_metadata_add(self, metadata, conflict_update=None): | ||||
self.state = metadata | self.state = metadata | ||||
self.conflict_update = conflict_update | self.conflict_update = conflict_update | ||||
def origin_head_add(self, revision, conflict_update=None): | |||||
self.state = revision | |||||
self.conflict_update = conflict_update | |||||
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': 'npm' | ||||
}, | }, | ||||
'version': '0.0.1', | 'version': '0.0.1', | ||||
▲ Show 20 Lines • Show All 96 Lines • Show Last 20 Lines |
should be updated according to the name change suggested above