archive_data = <swh.web.tests.conftest._ArchiveData object at 0x7f0e85b41588>
@given(content())
> def test_lookup_hash_exist(archive_data, content):
.tox/py3/lib/python3.7/site-packages/swh/web/tests/common/test_service.py:84:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.7/site-packages/swh/web/tests/common/test_service.py:85: in test_lookup_hash_exist
actual_lookup = service.lookup_hash("sha1:%s" % content["sha1"])
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
q = 'sha1:eb0b6fda0075bda88cba7d2594a0e500b41b7b51'
def lookup_hash(q: str) -> Dict[str, Any]:
"""Checks if the storage contains a given content checksum
Args:
q: query string of the form <hash_algo:hash>
Returns:
Dict with key found containing the hash info if the
hash is present, None if not.
"""
algo, hash = query.parse_hash(q)
found = _first_element(storage.content_find({algo: hash}))
if found:
> content = converters.from_content(found.to_dict())
E AttributeError: 'dict' object has no attribute 'to_dict'
.tox/py3/lib/python3.7/site-packages/swh/web/common/service.py:109: AttributeError
TEST RESULT
TEST RESULT
- Run At
- Aug 4 2020, 11:19 AM