client = <django.test.client.Client object at 0x7f0e7f233748>
@given(content())
> def test_content_badge(client, content):
.tox/py3/lib/python3.7/site-packages/swh/web/tests/misc/test_badges.py:41:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.7/site-packages/swh/web/tests/misc/test_badges.py:42: in test_content_badge
_test_badge_endpoints(client, CONTENT, content["sha1_git"])
.tox/py3/lib/python3.7/site-packages/swh/web/tests/misc/test_badges.py:145: in _test_badge_endpoints
resp = client.get(url)
.tox/py3/lib/python3.7/site-packages/django/test/client.py:535: in get
response = super().get(path, data=data, secure=secure, **extra)
.tox/py3/lib/python3.7/site-packages/django/test/client.py:347: in get
**extra,
.tox/py3/lib/python3.7/site-packages/django/test/client.py:422: in generic
return self.request(**r)
.tox/py3/lib/python3.7/site-packages/django/test/client.py:503: in request
raise exc_value
.tox/py3/lib/python3.7/site-packages/django/core/handlers/exception.py:34: in inner
response = get_response(request)
.tox/py3/lib/python3.7/site-packages/django/core/handlers/base.py:115: in _get_response
response = self.process_exception_by_middleware(e, request)
.tox/py3/lib/python3.7/site-packages/django/core/handlers/base.py:113: in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
.tox/py3/lib/python3.7/site-packages/swh/web/misc/badges.py:106: in _swh_badge
swh_object = service.lookup_object(object_type, object_id)
.tox/py3/lib/python3.7/site-packages/swh/web/common/service.py:1289: in lookup_object
return lookup_content(f"sha1_git:{object_id}")
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
q = 'sha1_git:7b423389d677952ac1034530fbf6057e5eea2bea'
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