self = <swh.indexer.tests.test_metadata.TestMetadata object at 0x7fa401564ac8>
def test_directory_metadata_indexer(self):
metadata_indexer = DirectoryMetadataIndexer(config=DIRECTORY_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
dir_ = DIRECTORY2
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([dir_.id])
results = list(
metadata_indexer.idx_storage.directory_intrinsic_metadata_get(
[DIRECTORY2.id]
)
)
expected_results = [
DirectoryIntrinsicMetadataRow(
id=dir_.id,
tool=TRANSLATOR_TOOL,
metadata=YARN_PARSER_METADATA,
mappings=["npm"],
)
]
for result in results:
del result.tool["id"]
> assert results == expected_results
E AssertionError: assert [] == [DirectoryInt...ings=['npm'])]
E Right contains one more item: DirectoryIntrinsicMetadataRow(indexer_configuration_id=None, tool={'name': 'swh-metadata-translator', 'version': '0.0.... 'yarn-parser', 'keywords': ['yarn', 'parse', 'lock', 'dependencies'], 'type': 'SoftwareSourceCode'}, mappings=['npm'])
E Full diff:
E - [DirectoryIntrinsicMetadataRow(indexer_configuration_id=None, tool={'name': 'swh-metadata-translator', 'version': '0.0.2', 'configuration': {'type': 'local', 'context': 'NpmMapping'}}, id=b'\xf8zz\xa1\x12`<1$\xfav\xf9\x01\xfd5\x85F`\xf2\xb6', metadata={'@context': 'https://doi.org/10.5063/schema/codemeta-2.0', 'url': 'ht...
E
E ...Full output truncated (2 lines hidden), use '-vv' to show
.tox/py3/lib/python3.7/site-packages/swh/indexer/tests/test_metadata.py:125: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Jul 4 2022, 2:14 PM