api_client = <rest_framework.test.APIClient object at 0x7f45de213470>
archived_origins = [{'type': 'tar', 'url': 'https://many.origins/186'}, {'type': 'tar', 'url': 'https://many.origins/100'}, {'type': 'tar...'}, {'type': 'tar', 'url': 'https://many.origins/163'}, {'type': 'git', 'url': 'https://git.example.org/project'}, ...]
def test_api_origin_search_empty_pattern_and_visit_type(api_client, archived_origins):
visit_types = {o["type"] for o in archived_origins}
for visit_type in visit_types:
url = reverse(
"api-1-origin-search",
url_args={"url_pattern": ""},
> query_params={"visit_type": visit_type, "limit": 10000},
)
.tox/py3/lib/python3.7/site-packages/swh/web/tests/api/views/test_origin.py:831:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
viewname = 'api-1-origin-search', url_args = {'url_pattern': ''}
query_params = {'limit': 10000, 'visit_type': 'git'}, current_app = None
urlconf = None, request = None
def reverse(
viewname: str,
url_args: Optional[Dict[str, Any]] = None,
query_params: Optional[QueryParameters] = None,
current_app: Optional[str] = None,
urlconf: Optional[str] = None,
request: Optional[HttpRequest] = None,
) -> str:
"""An override of django reverse function supporting query parameters.
Args:
viewname: the name of the django view from which to compute a url
url_args: dictionary of url arguments indexed by their names
query_params: dictionary of query parameters to append to the
reversed url
current_app: the name of the django app tighten to the view
urlconf: url configuration module
request: build an absolute URI if provided
Returns:
str: the url of the requested view with processed arguments and
query parameters
"""
if url_args:
url_args = {k: v for k, v in url_args.items() if v is not None}
url = django_reverse(
viewname, urlconf=urlconf, kwargs=url_args, current_app=current_app
)
if query_params:
query_params_dict = {k: v for k, v in query_params.items() if v is not None}
if len(query_params_dict) > 0:
query_dict = QueryDict("", mutable=True)
for k in sorted(query_params_dict.keys()):
value = query_params_dict[k]
> assert isinstance(value, str)
E assert False
E + where False = isinstance(10000, str)
.tox/py3/lib/python3.7/site-packages/swh/web/common/utils.py:104: AssertionError
TEST RESULT
TEST RESULT
- Run At
- May 25 2022, 4:46 PM