Page MenuHomeSoftware Heritage

Jenkins > .tox.py3.lib.python3.7.site-packages.swh.web.tests.api.views.test_snapshot::Tests / Python tests / test_api_snapshot_errors
Failed

TEST RESULT

Run At
Nov 26 2020, 6:22 PM
Details
api_client = <rest_framework.test.APIClient object at 0x7fdb347efd30> def test_api_snapshot_errors(api_client): unknown_snapshot_ = random_sha1() url = reverse("api-1-snapshot", url_args={"snapshot_id": "63ce369"}) check_api_get_responses(api_client, url, status_code=400) url = reverse("api-1-snapshot", url_args={"snapshot_id": unknown_snapshot_}) > check_api_get_responses(api_client, url, status_code=404) .tox/py3/lib/python3.7/site-packages/swh/web/tests/api/views/test_snapshot.py:125: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/py3/lib/python3.7/site-packages/swh/web/tests/utils.py:117: in check_api_get_responses api_client, url, status_code, content_type="application/json" .tox/py3/lib/python3.7/site-packages/swh/web/tests/utils.py:64: in check_http_get_response content_type=content_type, _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ response = <Response status_code=500, "application/json">, status_code = 404 content_type = 'application/json' def _assert_http_response( response: HttpResponse, status_code: int, content_type: str ) -> HttpResponse: 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 ) else: error_context = getattr(response, "traceback", response.content) > assert response.status_code == status_code, error_context E AssertionError: Traceback (most recent call last): E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/.tox/py3/lib/python3.7/site-packages/rest_framework/views.py", line 506, in dispatch E response = handler(request, *args, **kwargs) E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/.tox/py3/lib/python3.7/site-packages/rest_framework/decorators.py", line 50, in handler E return func(*args, **kwargs) E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/.tox/py3/lib/python3.7/site-packages/swh/web/api/apiurls.py", line 95, in api_view_f E response = f(request, **kwargs) E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/.tox/py3/lib/python3.7/site-packages/swh/web/api/apidoc.py", line 348, in documented_view E raise exc E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/.tox/py3/lib/python3.7/site-packages/swh/web/api/apidoc.py", line 345, in documented_view E return {"data": f(request, **kwargs), "doc_data": doc_data} E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/.tox/py3/lib/python3.7/site-packages/swh/web/api/views/snapshot.py", line 86, in api_snapshot E request=request, E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/.tox/py3/lib/python3.7/site-packages/swh/web/api/views/utils.py", line 67, in api_lookup E res = lookup_fn(*args) E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/.tox/py3/lib/python3.7/site-packages/swh/web/common/archive.py", line 1069, in lookup_snapshot E branches_name_pattern, E TypeError: snapshot_get_branches() takes from 2 to 5 positional arguments but 6 were given E E assert 500 == 404 E +500 E -404 .tox/py3/lib/python3.7/site-packages/swh/web/tests/utils.py:30: AssertionError