api_client = <rest_framework.test.APIClient object at 0x7f9e11a13d68>
archived_origins = [{'type': 'tar', 'url': 'https://many.origins/17'}, {'type': 'tar', 'url': 'https://many.origins/233'}, {'type': 'tar'...gins/172'}, {'type': 'tar', 'url': 'https://many.origins/33'}, {'type': 'tar', 'url': 'https://many.origins/124'}, ...]
def test_api_origin_search_empty_pattern(api_client, archived_origins):
url = reverse(
"api-1-origin-search",
url_args={"url_pattern": ""},
query_params={"limit": 10000},
)
> rv = check_api_get_responses(api_client, url, status_code=200)
.tox/py3/lib/python3.7/site-packages/swh/web/tests/api/views/test_origin.py:817:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.7/site-packages/swh/web/tests/utils.py:123: 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:68: in check_http_get_response
content_type=content_type,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <Response status_code=500, "application/json">, status_code = 200
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
)
elif isinstance(response, StreamingHttpResponse):
error_context = getattr(response, "traceback", response.streaming_content)
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@2/.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@2/.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@2/.tox/py3/lib/python3.7/site-packages/swh/web/api/apiurls.py", line 96, in api_view_f
E response = f(request, **kwargs)
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff@2/.tox/py3/lib/python3.7/site-packages/swh/web/api/apidoc.py", line 380, in documented_view
E raise exc
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff@2/.tox/py3/lib/python3.7/site-packages/swh/web/api/apidoc.py", line 377, in documented_view
E return {"data": f(request, **kwargs), "doc_data": doc_data}
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff@2/.tox/py3/lib/python3.7/site-packages/swh/web/api/views/origin.py", line 208, in api_origin_search
E request=request,
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff@2/.tox/py3/lib/python3.7/site-packages/swh/web/api/views/utils.py", line 68, in api_lookup
E res = lookup_fn(*args, **kwargs)
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff@2/.tox/py3/lib/python3.7/site-packages/swh/web/common/archive.py", line 357, in search_origin
E limit=limit,
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff@2/.tox/py3/lib/python3.7/site-packages/swh/search/in_memory.py", line 346, in origin_search
E "At least one of url_pattern and metadata_pattern must be provided."
E ValueError: At least one of url_pattern and metadata_pattern must be provided.
E
E assert 500 == 200
E + where 500 = <Response status_code=500, "application/json">.status_code
.tox/py3/lib/python3.7/site-packages/swh/web/tests/utils.py:34: AssertionError
TEST RESULT
TEST RESULT
- Run At
- May 6 2022, 2:39 PM