Page MenuHomeSoftware Heritage

Jenkins > .tox.py3.lib.python3.7.site-packages.swh.web.tests.browse.test_snapshot_context::Tests / Python tests / test_get_snapshot_context_with_origin
Failed

TEST RESULT

Run At
May 25 2022, 4:46 PM
Details
archive_data = <swh.web.tests.conftest._ArchiveData object at 0x7f45df4a3898> origin_with_multiple_visits = {'archives': ['highlightjs-line-numbers.js.zip', 'highlightjs-line-numbers.js_visit2.zip'], 'id': b'MZ\xc0H_lE[d\xcc\x...s://doi.org/10.5063/schema/codemeta-2.0', 'description': 'Line numbering plugin for Highlight.js'}, 'type': 'git', ...} def test_get_snapshot_context_with_origin(archive_data, origin_with_multiple_visits): origin_visits = get_origin_visits(origin_with_multiple_visits) timestamp = format_utc_iso_date(origin_visits[0]["date"], "%Y-%m-%dT%H:%M:%SZ") visit_id = origin_visits[1]["visit"] origin_url = origin_with_multiple_visits["url"] for browse_context, kwargs in ( ("content", {"origin_url": origin_url, "path": "/some/path"}), ("directory", {"origin_url": origin_url}), ("log", {"origin_url": origin_url}), ( "directory", { "origin_url": origin_url, "timestamp": timestamp, }, ), ( "directory", { "origin_url": origin_url, "visit_id": visit_id, }, ), ): visit_id = kwargs["visit_id"] if "visit_id" in kwargs else None visit_ts = kwargs["timestamp"] if "timestamp" in kwargs else None visit_info = get_origin_visit( {"url": kwargs["origin_url"]}, visit_ts=visit_ts, visit_id=visit_id ) snapshot = visit_info["snapshot"] > snapshot_context = get_snapshot_context(**kwargs, browse_context=browse_context) .tox/py3/lib/python3.7/site-packages/swh/web/tests/browse/test_snapshot_context.py:206: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/py3/lib/python3.7/site-packages/swh/web/browse/snapshot_context.py:457: in get_snapshot_context visit_url = reverse("browse-origin-directory", query_params=query_params) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ viewname = 'browse-origin-directory', url_args = None query_params = {'origin_url': 'https://github.com/wcoder/highlightjs-line-numbers.js', 'visit_id': 2} 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(2, str) .tox/py3/lib/python3.7/site-packages/swh/web/common/utils.py:104: AssertionError