archive_data = <swh.web.tests.conftest._ArchiveData object at 0x7f0e85b41588>
@given(content())
> def test_lookup_content_with_sha1(archive_data, content):
.tox/py3/lib/python3.7/site-packages/swh/web/tests/common/test_service.py:619:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.7/site-packages/swh/web/tests/common/test_service.py:620: in test_lookup_content_with_sha1
actual_content = service.lookup_content("sha1:%s" % content["sha1"])
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
q = 'sha1:eb0b6fda0075bda88cba7d2594a0e500b41b7b51'
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