self = <swh.indexer.tests.test_metadata.TestMetadata object at 0x7f9e289b6710>
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f9e1556a908>
def test_extrinsic_metadata_indexer_github(self, mocker):
"""Nominal case, calling the mapping and storing the result"""
origin = "https://example.org/jdoe/myrepo"
metadata_indexer = ExtrinsicMetadataIndexer(config=DIRECTORY_METADATA_CONFIG)
metadata_indexer.catch_exceptions = False
metadata_indexer.storage = mocker.patch.object(metadata_indexer, "storage")
metadata_indexer.storage.origin_get_by_sha1.return_value = [{"url": origin}]
tool = metadata_indexer.idx_storage.indexer_configuration_get(
{f"tool_{k}": v for (k, v) in TRANSLATOR_TOOL.items()}
)
assert tool is not None
> assert metadata_indexer.process_journal_objects(
{"raw_extrinsic_metadata": [REMD.to_dict()]}
) == {"status": "eventful", "origin_extrinsic_metadata:add": 1}
.tox/py3/lib/python3.7/site-packages/swh/indexer/tests/test_metadata.py:223:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.7/site-packages/swh/indexer/metadata.py:85: in process_journal_objects
results[remd.target] = self.index(remd.id, data=remd)
.tox/py3/lib/python3.7/site-packages/swh/indexer/metadata.py:127: in index
metadata_item = mapping.translate(data.metadata)
.tox/py3/lib/python3.7/site-packages/swh/indexer/metadata_dictionary/base.py:359: in translate
return self._translate_dict(content_dict)
.tox/py3/lib/python3.7/site-packages/swh/indexer/metadata_dictionary/base.py:221: in _translate_dict
root = self.get_root_uri(content_dict)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <swh.indexer.metadata_dictionary.github.GitHubMapping object at 0x7f9e154fcba8>
content_dict = {'full_name': 'test software'}
def get_root_uri(self, content_dict: dict) -> URIRef:
if isinstance(content_dict.get("html_url"), str):
return URIRef(content_dict["html_url"])
else:
> raise ValueError(f"Unexpected html_url in GitHub metadata: {content_dict}")
E ValueError: Unexpected html_url in GitHub metadata: {'full_name': 'test software'}
.tox/py3/lib/python3.7/site-packages/swh/indexer/metadata_dictionary/github.py:53: ValueError
TEST RESULT
TEST RESULT
- Run At
- Sep 15 2022, 9:00 AM