self = <swh.indexer.tests.test_metadata.Metadata testMethod=test_revision_metadata_indexer>
def test_revision_metadata_indexer(self):
metadata_indexer = RevisionMetadataIndexer(config=REVISION_METADATA_CONFIG)
fill_obj_storage(metadata_indexer.objstorage)
fill_storage(metadata_indexer.storage)
tool = metadata_indexer.idx_storage.indexer_configuration_get(
{f"tool_{k}": v for (k, v) in TRANSLATOR_TOOL.items()}
)
assert tool is not None
rev = REVISION
assert rev.directory == DIRECTORY2.id
metadata_indexer.idx_storage.content_metadata_add(
[
ContentMetadataRow(
id=DIRECTORY2.entries[0].target,
indexer_configuration_id=tool["id"],
metadata=YARN_PARSER_METADATA,
)
]
)
metadata_indexer.run([rev.id])
results = list(
metadata_indexer.idx_storage.revision_intrinsic_metadata_get([REVISION.id])
)
expected_results = [
RevisionIntrinsicMetadataRow(
id=rev.id,
tool=TRANSLATOR_TOOL,
metadata=YARN_PARSER_METADATA,
mappings=["npm"],
)
]
for result in results:
del result.tool["id"]
# then
> self.assertEqual(results, expected_results)
E AssertionError: Lists differ: [Revi[131 chars]': {'context': 'NpmMapping', 'type': 'local'}}[142 chars]=[])] != [Revi[131 chars]': {'type': 'local', 'context': 'NpmMapping'}}[650 chars]m'])]
E
E First differing element 0:
E Revis[130 chars]': {'context': 'NpmMapping', 'type': 'local'}}[141 chars]s=[])
E Revis[130 chars]': {'type': 'local', 'context': 'NpmMapping'}}[649 chars]pm'])
E
E - [RevisionIntrinsicMetadataRow(indexer_configuration_id=None, tool={'name': 'swh-metadata-translator', 'version': '0.0.2', 'configuration': {'context': 'NpmMapping', 'type': 'local'}}, id=b'\xc6 \x1c\xb1\xb9\xb9\xdf\x9auB\xf9f\\;]\xfa\xb8^\x97u', metadata={'@context': 'https://doi.org/10.5063/schema/codemeta-2.0'}, mappings=[])]
E + [RevisionIntrinsicMetadataRow(indexer_configuration_id=None, tool={'name': 'swh-metadata-translator', 'version': '0.0.2', 'configuration': {'type': 'local', 'context': 'NpmMapping'}}, id=b'\xc6 \x1c\xb1\xb9\xb9\xdf\x9auB\xf9f\\;]\xfa\xb8^\x97u', metadata={'@context': 'https://doi.org/10.5063/schema/codemeta-2.0', 'url': 'https://github.com/librariesio/yarn-parser#readme', 'codeRepository': 'git+git+https://github.com/librariesio/yarn-parser.git', 'author': [{'type': 'Person', 'name': 'Andrew Nesbitt'}], 'license': 'https://spdx.org/licenses/AGPL-3.0', 'version': '1.0.0', 'description': 'Tiny web service for parsing yarn.lock files', 'issueTracker': 'https://github.com/librariesio/yarn-parser/issues', 'name': 'yarn-parser', 'keywords': ['yarn', 'parse', 'lock', 'dependencies'], 'type': 'SoftwareSourceCode'}, mappings=['npm'])]
.tox/py3/lib/python3.7/site-packages/swh/indexer/tests/test_metadata.py:1273: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Apr 18 2022, 8:43 PM