Page MenuHomeSoftware Heritage
Paste P1376

(An Untitled Masterwork)
ActivePublic

Authored by anlambert on Jun 3 2022, 11:25 AM.
swh/web/tests/api/views/test_metadata.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
swh/web/tests/conftest.py:1106: in inner
item.ihook.pytest_runtest_call(item=item)
../../../.virtualenvs/swh/lib/python3.9/site-packages/pluggy/_hooks.py:265: in __call__
return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
../../../.virtualenvs/swh/lib/python3.9/site-packages/pluggy/_manager.py:80: in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
../../../.virtualenvs/swh/lib/python3.9/site-packages/_pytest/runner.py:174: in pytest_runtest_call
raise e
../../../.virtualenvs/swh/lib/python3.9/site-packages/_pytest/runner.py:166: in pytest_runtest_call
item.runtest()
../../../.virtualenvs/swh/lib/python3.9/site-packages/_pytest/python.py:1761: in runtest
self.ihook.pytest_pyfunc_call(pyfuncitem=self)
../../../.virtualenvs/swh/lib/python3.9/site-packages/pluggy/_hooks.py:265: in __call__
return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
../../../.virtualenvs/swh/lib/python3.9/site-packages/pluggy/_manager.py:80: in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
../../../.virtualenvs/swh/lib/python3.9/site-packages/_pytest/python.py:192: in pytest_pyfunc_call
result = testfunction(**testargs)
swh/web/tests/api/views/test_metadata.py:105: in test_inner
results = scroll_results(api_client, url)
swh/web/tests/api/views/utils.py:16: in scroll_results
rv = check_api_get_responses(api_client, url, status_code=200)
swh/web/tests/utils.py:122: in check_api_get_responses
response_json = check_http_get_response(
swh/web/tests/utils.py:60: in check_http_get_response
return _assert_http_response(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <Response status_code=500, "application/json">, status_code = 200, content_type = 'application/json'
def _assert_http_response(
response: HttpResponseBase, status_code: int, content_type: str
) -> HttpResponseBase:
if isinstance(response, Response):
drf_response = cast(Response, response)
error_context = (
drf_response.data.pop("traceback")
if isinstance(drf_response.data, dict) and "traceback" in drf_response.data
else drf_response.data
)
elif isinstance(response, StreamingHttpResponse):
error_context = getattr(response, "traceback", response.streaming_content)
elif isinstance(response, HttpResponse):
error_context = getattr(response, "traceback", response.content)
> assert response.status_code == status_code, error_context
E AssertionError: Traceback (most recent call last):
E File "/home/anlambert/.virtualenvs/swh/lib/python3.9/site-packages/rest_framework/views.py", line 506, in dispatch
E response = handler(request, *args, **kwargs)
E File "/home/anlambert/.virtualenvs/swh/lib/python3.9/site-packages/rest_framework/decorators.py", line 50, in handler
E return func(*args, **kwargs)
E File "/home/anlambert/swh/swh-environment/swh-web/swh/web/api/apiurls.py", line 96, in api_view_f
E response = f(request, **kwargs)
E File "/home/anlambert/swh/swh-environment/swh-web/swh/web/api/apidoc.py", line 380, in documented_view
E raise exc
E File "/home/anlambert/swh/swh-environment/swh-web/swh/web/api/apidoc.py", line 377, in documented_view
E return {"data": f(request, **kwargs), "doc_data": doc_data}
E File "/home/anlambert/swh/swh-environment/swh-web/swh/web/api/views/metadata.py", line 118, in api_raw_extrinsic_metadata_swhid
E result_page = archive.storage.raw_extrinsic_metadata_get(
E File "/home/anlambert/swh/swh-environment/swh-storage/swh/storage/cassandra/storage.py", line 1516, in raw_extrinsic_metadata_get
E (after_date, id_) = msgpack_loads(base64.b64decode(page_token))
E File "/usr/lib/python3.9/base64.py", line 87, in b64decode
E return binascii.a2b_base64(s)
E binascii.Error: Invalid base64-encoded string: number of data characters (9) cannot be 1 more than a multiple of 4
E
E assert 500 == 200
E + where 500 = <Response status_code=500, "application/json">.status_code
swh/web/tests/utils.py:34: AssertionError