archive_data = <swh.web.tests.conftest._ArchiveData object at 0x7f0e85b41588>
@given(content())
> def test_lookup_content_raw(archive_data, content):
.tox/py3/lib/python3.7/site-packages/swh/web/tests/common/test_service.py:598:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.7/site-packages/swh/web/tests/common/test_service.py:599: in test_lookup_content_raw
actual_content = service.lookup_content_raw("sha256:%s" % content["sha256"])
.tox/py3/lib/python3.7/site-packages/swh/web/common/service.py:860: in lookup_content_raw
c = lookup_content(q)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
q = 'sha256:78fec172cd4c6a5d23e9e6dd0bcc26496903549b57c749b6f5ca26209b87738d'
def lookup_content(q: str) -> Dict[str, Any]:
"""Lookup the content designed by q.
Args:
q: The release's sha1 as hexadecimal
Raises:
NotFoundExc if the requested content is not found
"""
algo, hash_ = query.parse_hash(q)
c = _first_element(storage.content_find({algo: hash_}))
if not c:
hhex = hashutil.hash_to_hex(hash_)
raise NotFoundExc(f"Content with {algo} checksum equals to {hhex} not found!")
> return converters.from_content(c.to_dict())
E AttributeError: 'dict' object has no attribute 'to_dict'
.tox/py3/lib/python3.7/site-packages/swh/web/common/service.py:842: AttributeError
TEST RESULT
TEST RESULT
- Run At
- Aug 4 2020, 11:19 AM