Page MenuHomeSoftware Heritage
Paste P797

swh-web tests after arc patch D4118
ActivePublic

Authored by anlambert on Oct 2 2020, 1:34 PM.
python3 -m pytest --hypothesis-profile=swh-web-fast ./swh/web/tests
============================= test session starts ==============================
platform linux -- Python 3.7.3, pytest-6.1.0, py-1.9.0, pluggy-0.13.1
django: settings: swh.web.settings.tests (from ini)
rootdir: /home/anlambert/swh/swh-environment/swh-web, configfile: pytest.ini
plugins: aiohttp-0.3.0, asyncio-0.14.0, django-3.9.0, mock-3.3.1, requests-mock-1.8.0, hypothesis-5.33.1, forked-1.3.0, xdist-2.1.0, dash-1.16.0, postgresql-2.4.1, swh.journal-0.4.4.dev1+g7815cad, swh.core-0.3.1.dev1+gd46d4c7
collected 459 items
swh/web/tests/admin/test_origin_save.py ....... [ 1%]
swh/web/tests/api/test_throttling.py ... [ 2%]
swh/web/tests/api/views/test_origin_save.py ........ [ 3%]
swh/web/tests/auth/test_api_auth.py ... [ 4%]
swh/web/tests/auth/test_backends.py ...... [ 5%]
swh/web/tests/auth/test_middlewares.py .. [ 6%]
swh/web/tests/auth/test_views.py ............. [ 9%]
swh/web/tests/common/test_origin_save.py ...... [ 10%]
swh/web/tests/misc/test_metrics.py . [ 10%]
swh/web/tests/test_gunicorn_config.py ... [ 11%]
swh/web/tests/api/test_api_lookup.py ........ [ 13%]
swh/web/tests/api/test_apidoc.py .......... [ 15%]
swh/web/tests/api/test_apiresponse.py .......... [ 17%]
swh/web/tests/api/test_throttling.py ... [ 18%]
swh/web/tests/api/test_utils.py ......................... [ 23%]
swh/web/tests/api/views/test_content.py ..s.s.ssF......... [ 27%]
swh/web/tests/api/views/test_directory.py ..... [ 28%]
swh/web/tests/api/views/test_graph.py ....... [ 30%]
swh/web/tests/api/views/test_identifiers.py ....... [ 31%]
swh/web/tests/api/views/test_origin.py ................................. [ 38%]
... [ 39%]
swh/web/tests/api/views/test_ping.py . [ 39%]
swh/web/tests/api/views/test_release.py .... [ 40%]
swh/web/tests/api/views/test_revision.py .......... [ 42%]
swh/web/tests/api/views/test_snapshot.py ...... [ 44%]
swh/web/tests/api/views/test_stat.py .... [ 44%]
swh/web/tests/api/views/test_vault.py ... [ 45%]
swh/web/tests/auth/test_api_auth.py . [ 45%]
swh/web/tests/auth/test_backends.py . [ 45%]
swh/web/tests/auth/test_utils.py ... [ 46%]
swh/web/tests/auth/test_views.py ........ [ 48%]
swh/web/tests/browse/test_snapshot_context.py .... [ 49%]
swh/web/tests/browse/test_utils.py .... [ 50%]
swh/web/tests/browse/views/test_content.py FFFFFFFFF....FFF [ 53%]
swh/web/tests/browse/views/test_directory.py ....... [ 55%]
swh/web/tests/browse/views/test_identifiers.py ........F. [ 57%]
swh/web/tests/browse/views/test_origin.py .F....................... [ 62%]
swh/web/tests/browse/views/test_release.py .... [ 63%]
swh/web/tests/browse/views/test_revision.py ..... [ 64%]
swh/web/tests/common/test_converters.py ................... [ 68%]
swh/web/tests/common/test_highlightjs.py .. [ 69%]
swh/web/tests/common/test_identifiers.py .......... [ 71%]
swh/web/tests/common/test_origin_visits.py ...... [ 72%]
swh/web/tests/common/test_query.py ................ [ 76%]
swh/web/tests/common/test_service.py ......s..s..s...................... [ 83%]
........................................ [ 92%]
swh/web/tests/common/test_templatetags.py .... [ 93%]
swh/web/tests/common/test_utils.py .................. [ 97%]
swh/web/tests/misc/test_badges.py ........ [ 99%]
swh/web/tests/misc/test_origin_save.py .... [100%]
=================================== FAILURES ===================================
____________________ test_api_content_license_sha_not_found ____________________
api_client = <rest_framework.test.APIClient object at 0x7f9ce5d41fd0>
def test_api_content_license_sha_not_found(api_client):
unknown_content_ = random_content()
url = reverse(
"api-1-content-license", url_args={"q": "sha1:%s" % unknown_content_["sha1"]}
)
> rv = check_api_get_responses(api_client, url, status_code=404)
swh/web/tests/api/views/test_content.py:196:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
api_client = <rest_framework.test.APIClient object at 0x7f9ce5d41fd0>
url = '/api/1/content/sha1:e4bfc067a84115667bae4a2e0f9236646077236a/license/'
status_code = 404
def check_api_get_responses(
api_client: APIClient, url: str, status_code: int
) -> Response:
"""Helper function to check Web API responses to GET requests
for all accepted content types.
Args:
api_client: DRF test client
url: Web API URL to check responses
status_code: expected HTTP status code
Returns:
The Web API JSON response
"""
# check API Web UI
html_content_type = "text/html"
resp = api_client.get(url, HTTP_ACCEPT=html_content_type)
> assert resp.status_code == status_code, resp.content
E AssertionError: b'
E
E <!DOCTYPE html>
E
E
E
E
E
E
E <html lang="en">
E <head>
E <meta charset="utf-8">
E <meta http-equiv="X-UA-...ng" /></a>
E </div>
E <script>
E swh.webapp.setContainerFullWidth();
E </script>
E </body>
E
E </html>
E '
E assert 200 == 404
E + where 200 = <Response status_code=200, "text/html">.status_code
swh/web/tests/api/views/__init__.py:29: AssertionError
____________________________ test_content_view_text ____________________________
client = <django.test.client.Client object at 0x7f9ce28a87f0>
archive_data = <swh.web.tests.conftest._ArchiveData object at 0x7f9ce781b6a0>
@given(content_text())
> def test_content_view_text(client, archive_data, content):
swh/web/tests/browse/views/test_content.py:42:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
client = <django.test.client.Client object at 0x7f9ce28a87f0>
archive_data = <swh.web.tests.conftest._ArchiveData object at 0x7f9ce781b6a0>
content = {'blake2s256': '0b7f6d658223614f6bac9286b842eb21dfd23e575aee9783d634a210e0e490dd', 'data': '!function(e){"use strict";...tLineNumbersOnLoad=t,e.hljs.lineNumbersBlock=r)}(window);', 'encoding': 'us-ascii', 'hljs_language': 'javascript', ...}
@given(content_text())
def test_content_view_text(client, archive_data, content):
sha1_git = content["sha1_git"]
url = reverse(
"browse-content",
url_args={"query_string": content["sha1"]},
query_params={"path": content["path"]},
)
url_raw = reverse("browse-content-raw", url_args={"query_string": content["sha1"]})
resp = client.get(url)
content_display = _process_content_for_display(archive_data, content)
mimetype = content_display["mimetype"]
> assert resp.status_code == 200
E assert 500 == 200
E + where 500 = <HttpResponse status_code=500, "text/html; charset=utf-8">.status_code
swh/web/tests/browse/views/test_content.py:58: AssertionError
---------------------------------- Hypothesis ----------------------------------
Falsifying example: test_content_view_text(
client=<django.test.client.Client at 0x7f9ce28a87f0>,
archive_data=<swh.web.tests.conftest._ArchiveData at 0x7f9ce781b6a0>,
content={'blake2s256': '0b7f6d658223614f6bac9286b842eb21dfd23e575aee9783d634a210e0e490dd',
'data': '!function(e){"use strict";function t(){"complete"===document.readyState?n():e.addEventListener("DOMContentLoaded",n)}function n(){try{var e=document.querySelectorAll("code.hljs");for(var t in e)e.hasOwnProperty(t)&&r(e[t])}catch(n){console.error("LineNumbers error: ",n)}}function r(e){if("object"==typeof e){var t=e.parentNode,n=o(t.textContent);if(n>1){for(var r="",c=0;n>c;c++)r+=c+1+"\\n";var l=document.createElement("code");l.className="hljs hljs-line-numbers",l.style["float"]="left",l.textContent=r,t.insertBefore(l,e)}}}function o(e){if(0===e.length)return 0;var t=/\\r\\n|\\r|\\n/g,n=e.match(t);return n=n?n.length:0,e[e.length-1].match(t)||(n+=1),n}"undefined"==typeof e.hljs?console.error("highlight.js not detected!"):(e.hljs.initLineNumbersOnLoad=t,e.hljs.lineNumbersBlock=r)}(window);',
'encoding': 'us-ascii',
'hljs_language': 'javascript',
'mimetype': 'text/plain',
'path': 'f49a027191d2c97002c5b86c2639aba1d36460e7/dist/highlightjs-line-numbers.min.js',
'sha1': '45082980517d85e647858458f9478f414e574023',
'sha1_git': '6d0a3cbe18e16bca3e53db4a1c4cc1fc90bd655f',
'sha256': '4380e0d8da31d5f4dd58ca4693f55e173b9cfc4763c49a4f8d25be78ccc70899'},
)
_____________________ test_content_view_text_no_highlight ______________________
client = <django.test.client.Client object at 0x7f9ce2871b70>
archive_data = <swh.web.tests.conftest._ArchiveData object at 0x7f9ce781b6a0>
@given(content_text_no_highlight())
> def test_content_view_text_no_highlight(client, archive_data, content):
swh/web/tests/browse/views/test_content.py:73:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
client = <django.test.client.Client object at 0x7f9ce2871b70>
archive_data = <swh.web.tests.conftest._ArchiveData object at 0x7f9ce781b6a0>
content = {'blake2s256': '683794acca5e47e33fd2f2527c9345d251cf07375d21ac48b9d4b64818870727', 'data': '\ufeff/* Localized version...adableCopyright = "Copyright 2009 __MyCompanyName__.";\n', 'encoding': 'utf-16le', 'hljs_language': 'nohighlight', ...}
@given(content_text_no_highlight())
def test_content_view_text_no_highlight(client, archive_data, content):
sha1_git = content["sha1_git"]
url = reverse("browse-content", url_args={"query_string": content["sha1"]})
url_raw = reverse("browse-content-raw", url_args={"query_string": content["sha1"]})
resp = client.get(url)
content_display = _process_content_for_display(archive_data, content)
> assert resp.status_code == 200
E assert 500 == 200
E + where 500 = <HttpResponse status_code=500, "text/html; charset=utf-8">.status_code
swh/web/tests/browse/views/test_content.py:84: AssertionError
---------------------------------- Hypothesis ----------------------------------
Falsifying example: test_content_view_text_no_highlight(
client=<django.test.client.Client at 0x7f9ce2871b70>,
archive_data=<swh.web.tests.conftest._ArchiveData at 0x7f9ce781b6a0>,
content={'blake2s256': '683794acca5e47e33fd2f2527c9345d251cf07375d21ac48b9d4b64818870727',
'data': '\ufeff/* Localized versions of Info.plist keys */\n\nCFBundleName = "libtess2";\nCFBundleShortVersionString = "libtess2 version 0.1";\nCFBundleGetInfoString = "libtess2 version 0.1, Copyright 2009 __MyCompanyName__.";\nNSHumanReadableCopyright = "Copyright 2009 __MyCompanyName__.";\n',
'encoding': 'utf-16le',
'hljs_language': 'nohighlight',
'mimetype': 'text/plain',
'path': 'a7f3e08d43f514a87888b6cdcfe9f7f09ca081ae/Build/Xcode/English.lproj/InfoPlist.strings',
'sha1': '6b0b8021d25c7c28c450ccbaa6e8e17641e16ca4',
'sha1_git': 'b416943e8feccbbd60d264df880d5ea42f37c54c',
'sha256': '1866e2e10264cad16644970f1bc88711886b4aed397267a1b30b3e58234f321b'},
)
________________________ test_content_view_no_utf8_text ________________________
client = <django.test.client.Client object at 0x7f9ce0ebc0f0>
archive_data = <swh.web.tests.conftest._ArchiveData object at 0x7f9ce781b6a0>
@given(content_text_non_utf8())
> def test_content_view_no_utf8_text(client, archive_data, content):
swh/web/tests/browse/views/test_content.py:99:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
client = <django.test.client.Client object at 0x7f9ce0ebc0f0>
archive_data = <swh.web.tests.conftest._ArchiveData object at 0x7f9ce781b6a0>
content = {'blake2s256': '683794acca5e47e33fd2f2527c9345d251cf07375d21ac48b9d4b64818870727', 'data': '\ufeff/* Localized version...adableCopyright = "Copyright 2009 __MyCompanyName__.";\n', 'encoding': 'utf-16le', 'hljs_language': 'nohighlight', ...}
@given(content_text_non_utf8())
def test_content_view_no_utf8_text(client, archive_data, content):
sha1_git = content["sha1_git"]
url = reverse("browse-content", url_args={"query_string": content["sha1"]})
resp = client.get(url)
content_display = _process_content_for_display(archive_data, content)
> assert resp.status_code == 200
E assert 500 == 200
E + where 500 = <HttpResponse status_code=500, "text/html; charset=utf-8">.status_code
swh/web/tests/browse/views/test_content.py:108: AssertionError
---------------------------------- Hypothesis ----------------------------------
Falsifying example: test_content_view_no_utf8_text(
client=<django.test.client.Client at 0x7f9ce0ebc0f0>,
archive_data=<swh.web.tests.conftest._ArchiveData at 0x7f9ce781b6a0>,
content={'blake2s256': '683794acca5e47e33fd2f2527c9345d251cf07375d21ac48b9d4b64818870727',
'data': '\ufeff/* Localized versions of Info.plist keys */\n\nCFBundleName = "libtess2";\nCFBundleShortVersionString = "libtess2 version 0.1";\nCFBundleGetInfoString = "libtess2 version 0.1, Copyright 2009 __MyCompanyName__.";\nNSHumanReadableCopyright = "Copyright 2009 __MyCompanyName__.";\n',
'encoding': 'utf-16le',
'hljs_language': 'nohighlight',
'mimetype': 'text/plain',
'path': 'a7f3e08d43f514a87888b6cdcfe9f7f09ca081ae/Build/Xcode/English.lproj/InfoPlist.strings',
'sha1': '6b0b8021d25c7c28c450ccbaa6e8e17641e16ca4',
'sha1_git': 'b416943e8feccbbd60d264df880d5ea42f37c54c',
'sha256': '1866e2e10264cad16644970f1bc88711886b4aed397267a1b30b3e58234f321b'},
)
___________________________ test_content_view_image ____________________________
client = <django.test.client.Client object at 0x7f9ce0e6c7b8>
archive_data = <swh.web.tests.conftest._ArchiveData object at 0x7f9ce781b6a0>
@given(content_image_type())
> def test_content_view_image(client, archive_data, content):
swh/web/tests/browse/views/test_content.py:117:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
client = <django.test.client.Client object at 0x7f9ce0e6c7b8>
archive_data = <swh.web.tests.conftest._ArchiveData object at 0x7f9ce781b6a0>
content = {'blake2s256': 'd372bfca526245a5c11c0915b13f392121741e9762733f5a80fb2c1b10acb5e4', 'data': 'PD94bWwgdmVyc2lvbj0iMS4wIi...NSw2OS40OTggDQoJMCw0MS41OTUgMzkuNTU5LDM1Ljg0OCAiLz4NCjwvc3ZnPg0K', 'encoding': 'us-ascii', 'hljs_language': 'xml', ...}
@given(content_image_type())
def test_content_view_image(client, archive_data, content):
url = reverse("browse-content", url_args={"query_string": content["sha1"]})
url_raw = reverse("browse-content-raw", url_args={"query_string": content["sha1"]})
resp = client.get(url)
content_display = _process_content_for_display(archive_data, content)
mimetype = content_display["mimetype"]
content_data = content_display["content_data"]
> assert resp.status_code == 200
E assert 500 == 200
E + where 500 = <HttpResponse status_code=500, "text/html; charset=utf-8">.status_code
swh/web/tests/browse/views/test_content.py:128: AssertionError
---------------------------------- Hypothesis ----------------------------------
Falsifying example: test_content_view_image(
client=<django.test.client.Client at 0x7f9ce0e6c7b8>,
archive_data=<swh.web.tests.conftest._ArchiveData at 0x7f9ce781b6a0>,
content={'blake2s256': 'd372bfca526245a5c11c0915b13f392121741e9762733f5a80fb2c1b10acb5e4',
'data': 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pg0KPHN2ZyB2ZXJzaW9uPSIxLjEiIGJhc2VQcm9maWxlPSJ0aW55Ij4NCjxkZWZzPg0KPC9kZWZzPg0KPHBvbHlnb24gcG9pbnRzPSI1Ny4yNSwwIDc0Ljk0MSwzNS44NDggMTE0LjUsNDEuNTk1IDg1Ljg3NSw2OS40OTggOTIuNjMzLDEwOC44OTcgNTcuMjUsOTAuMjk2IDIxLjg2OCwxMDguODk3IDI4LjYyNSw2OS40OTggDQoJMCw0MS41OTUgMzkuNTU5LDM1Ljg0OCAiLz4NCjwvc3ZnPg0K',
'encoding': 'us-ascii',
'hljs_language': 'xml',
'mimetype': 'image/svg+xml',
'path': '30f4c24c351ac28677ebe72ef2da295d6bda4ef7/Bin/fg.svg',
'sha1': '32d6be6e38481ef2340752d8fd92693b463f6736',
'sha1_git': 'ae998cd8ef33212d2dbfd8860a28c559a839d254',
'sha256': '33497bd8fc633711b5ff7c82d01f8598d5f340340a33ba28d031dc88c8a7dd7e'},
)
_____________________ test_content_view_image_no_rendering _____________________
client = <django.test.client.Client object at 0x7f9ce0e905c0>
archive_data = <swh.web.tests.conftest._ArchiveData object at 0x7f9ce781b6a0>
@given(content_unsupported_image_type_rendering())
> def test_content_view_image_no_rendering(client, archive_data, content):
swh/web/tests/browse/views/test_content.py:135:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
client = <django.test.client.Client object at 0x7f9ce0e905c0>
archive_data = <swh.web.tests.conftest._ArchiveData object at 0x7f9ce781b6a0>
content = {'blake2s256': 'b2bc63e7c3580338cbe00d9e0797b397aea3acd56ab35c29ab56b0fd87aace56', 'data': b'P1\n# PBM example\n24 7\n...0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0', 'encoding': 'us-ascii', 'hljs_language': 'nohighlight', ...}
@given(content_unsupported_image_type_rendering())
def test_content_view_image_no_rendering(client, archive_data, content):
url = reverse("browse-content", url_args={"query_string": content["sha1"]})
resp = client.get(url)
mimetype = content["mimetype"]
encoding = content["encoding"]
> assert resp.status_code == 200
E assert 500 == 200
E + where 500 = <HttpResponse status_code=500, "text/html; charset=utf-8">.status_code
swh/web/tests/browse/views/test_content.py:143: AssertionError
---------------------------------- Hypothesis ----------------------------------
Falsifying example: test_content_view_image_no_rendering(
client=<django.test.client.Client at 0x7f9ce0e905c0>,
archive_data=<swh.web.tests.conftest._ArchiveData at 0x7f9ce781b6a0>,
content={'blake2s256': 'b2bc63e7c3580338cbe00d9e0797b397aea3acd56ab35c29ab56b0fd87aace56',
'data': b'P1\n# PBM example\n24 7\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0\n0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0\n0 1 1 1 0 0 0 1 1 1 0 0 0 1 1 1 0 0 0 1 1 1 1 0\n0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0\n0 1 0 0 0 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0',
'encoding': 'us-ascii',
'hljs_language': 'nohighlight',
'mimetype': 'image/x-portable-bitmap',
'path': '',
'sha1': '18131b34d9bf5ab6b0b1b19c6803aa78f2e3b352',
'sha1_git': '4b0ce1d0d67628f8d8554c19de3f794f649fdb2c',
'sha256': 'c0fcda8554d8c17039bd982f4a3de7140c88d3b3b2fa8491c6a2110551b81982'},
)
_______________________ test_content_view_text_with_path _______________________
client = <django.test.client.Client object at 0x7f9ce07018d0>
archive_data = <swh.web.tests.conftest._ArchiveData object at 0x7f9ce781b6a0>
@given(content_text())
> def test_content_view_text_with_path(client, archive_data, content):
swh/web/tests/browse/views/test_content.py:155:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
client = <django.test.client.Client object at 0x7f9ce07018d0>
archive_data = <swh.web.tests.conftest._ArchiveData object at 0x7f9ce781b6a0>
content = {'blake2s256': '0b7f6d658223614f6bac9286b842eb21dfd23e575aee9783d634a210e0e490dd', 'data': '!function(e){"use strict";...tLineNumbersOnLoad=t,e.hljs.lineNumbersBlock=r)}(window);', 'encoding': 'us-ascii', 'hljs_language': 'javascript', ...}
@given(content_text())
def test_content_view_text_with_path(client, archive_data, content):
path = content["path"]
url = reverse(
"browse-content",
url_args={"query_string": content["sha1"]},
query_params={"path": path},
)
resp = client.get(url)
> assert resp.status_code == 200
E assert 500 == 200
E + where 500 = <HttpResponse status_code=500, "text/html; charset=utf-8">.status_code
swh/web/tests/browse/views/test_content.py:165: AssertionError
---------------------------------- Hypothesis ----------------------------------
Falsifying example: test_content_view_text_with_path(
client=<django.test.client.Client at 0x7f9ce07018d0>,
archive_data=<swh.web.tests.conftest._ArchiveData at 0x7f9ce781b6a0>,
content={'blake2s256': '0b7f6d658223614f6bac9286b842eb21dfd23e575aee9783d634a210e0e490dd',
'data': '!function(e){"use strict";function t(){"complete"===document.readyState?n():e.addEventListener("DOMContentLoaded",n)}function n(){try{var e=document.querySelectorAll("code.hljs");for(var t in e)e.hasOwnProperty(t)&&r(e[t])}catch(n){console.error("LineNumbers error: ",n)}}function r(e){if("object"==typeof e){var t=e.parentNode,n=o(t.textContent);if(n>1){for(var r="",c=0;n>c;c++)r+=c+1+"\\n";var l=document.createElement("code");l.className="hljs hljs-line-numbers",l.style["float"]="left",l.textContent=r,t.insertBefore(l,e)}}}function o(e){if(0===e.length)return 0;var t=/\\r\\n|\\r|\\n/g,n=e.match(t);return n=n?n.length:0,e[e.length-1].match(t)||(n+=1),n}"undefined"==typeof e.hljs?console.error("highlight.js not detected!"):(e.hljs.initLineNumbersOnLoad=t,e.hljs.lineNumbersBlock=r)}(window);',
'encoding': 'us-ascii',
'hljs_language': 'javascript',
'mimetype': 'text/plain',
'path': 'f49a027191d2c97002c5b86c2639aba1d36460e7/dist/highlightjs-line-numbers.min.js',
'sha1': '45082980517d85e647858458f9478f414e574023',
'sha1_git': '6d0a3cbe18e16bca3e53db4a1c4cc1fc90bd655f',
'sha256': '4380e0d8da31d5f4dd58ca4693f55e173b9cfc4763c49a4f8d25be78ccc70899'},
)
____________________________ test_content_raw_text _____________________________
client = <django.test.client.Client object at 0x7f9ce0701358>
archive_data = <swh.web.tests.conftest._ArchiveData object at 0x7f9ce781b6a0>
@given(content_text())
> def test_content_raw_text(client, archive_data, content):
swh/web/tests/browse/views/test_content.py:244:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
client = <django.test.client.Client object at 0x7f9ce0701358>
archive_data = <swh.web.tests.conftest._ArchiveData object at 0x7f9ce781b6a0>
content = {'blake2s256': '0b7f6d658223614f6bac9286b842eb21dfd23e575aee9783d634a210e0e490dd', 'data': '!function(e){"use strict";...tLineNumbersOnLoad=t,e.hljs.lineNumbersBlock=r)}(window);', 'encoding': 'us-ascii', 'hljs_language': 'javascript', ...}
@given(content_text())
def test_content_raw_text(client, archive_data, content):
url = reverse("browse-content-raw", url_args={"query_string": content["sha1"]})
resp = client.get(url)
content_data = archive_data.content_get_data(content["sha1"])["data"]
> assert resp.status_code == 200
E assert 500 == 200
E + where 500 = <HttpResponse status_code=500, "text/html; charset=utf-8">.status_code
swh/web/tests/browse/views/test_content.py:251: AssertionError
---------------------------------- Hypothesis ----------------------------------
Falsifying example: test_content_raw_text(
client=<django.test.client.Client at 0x7f9ce0701358>,
archive_data=<swh.web.tests.conftest._ArchiveData at 0x7f9ce781b6a0>,
content={'blake2s256': '0b7f6d658223614f6bac9286b842eb21dfd23e575aee9783d634a210e0e490dd',
'data': '!function(e){"use strict";function t(){"complete"===document.readyState?n():e.addEventListener("DOMContentLoaded",n)}function n(){try{var e=document.querySelectorAll("code.hljs");for(var t in e)e.hasOwnProperty(t)&&r(e[t])}catch(n){console.error("LineNumbers error: ",n)}}function r(e){if("object"==typeof e){var t=e.parentNode,n=o(t.textContent);if(n>1){for(var r="",c=0;n>c;c++)r+=c+1+"\\n";var l=document.createElement("code");l.className="hljs hljs-line-numbers",l.style["float"]="left",l.textContent=r,t.insertBefore(l,e)}}}function o(e){if(0===e.length)return 0;var t=/\\r\\n|\\r|\\n/g,n=e.match(t);return n=n?n.length:0,e[e.length-1].match(t)||(n+=1),n}"undefined"==typeof e.hljs?console.error("highlight.js not detected!"):(e.hljs.initLineNumbersOnLoad=t,e.hljs.lineNumbersBlock=r)}(window);',
'encoding': 'us-ascii',
'hljs_language': 'javascript',
'mimetype': 'text/plain',
'path': 'f49a027191d2c97002c5b86c2639aba1d36460e7/dist/highlightjs-line-numbers.min.js',
'sha1': '45082980517d85e647858458f9478f414e574023',
'sha1_git': '6d0a3cbe18e16bca3e53db4a1c4cc1fc90bd655f',
'sha256': '4380e0d8da31d5f4dd58ca4693f55e173b9cfc4763c49a4f8d25be78ccc70899'},
)
________________________ test_content_raw_no_utf8_text _________________________
client = <django.test.client.Client object at 0x7f9ce06a43c8>
@given(content_text_non_utf8())
> def test_content_raw_no_utf8_text(client, content):
swh/web/tests/browse/views/test_content.py:273:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
client = <django.test.client.Client object at 0x7f9ce06a43c8>
content = {'blake2s256': '683794acca5e47e33fd2f2527c9345d251cf07375d21ac48b9d4b64818870727', 'data': '\ufeff/* Localized version...adableCopyright = "Copyright 2009 __MyCompanyName__.";\n', 'encoding': 'utf-16le', 'hljs_language': 'nohighlight', ...}
@given(content_text_non_utf8())
def test_content_raw_no_utf8_text(client, content):
url = reverse("browse-content-raw", url_args={"query_string": content["sha1"]})
resp = client.get(url)
> assert resp.status_code == 200
E assert 500 == 200
E + where 500 = <HttpResponse status_code=500, "text/html; charset=utf-8">.status_code
swh/web/tests/browse/views/test_content.py:277: AssertionError
---------------------------------- Hypothesis ----------------------------------
Falsifying example: test_content_raw_no_utf8_text(
client=<django.test.client.Client at 0x7f9ce06a43c8>,
content={'blake2s256': '683794acca5e47e33fd2f2527c9345d251cf07375d21ac48b9d4b64818870727',
'data': '\ufeff/* Localized versions of Info.plist keys */\n\nCFBundleName = "libtess2";\nCFBundleShortVersionString = "libtess2 version 0.1";\nCFBundleGetInfoString = "libtess2 version 0.1, Copyright 2009 __MyCompanyName__.";\nNSHumanReadableCopyright = "Copyright 2009 __MyCompanyName__.";\n',
'encoding': 'utf-16le',
'hljs_language': 'nohighlight',
'mimetype': 'text/plain',
'path': 'a7f3e08d43f514a87888b6cdcfe9f7f09ca081ae/Build/Xcode/English.lproj/InfoPlist.strings',
'sha1': '6b0b8021d25c7c28c450ccbaa6e8e17641e16ca4',
'sha1_git': 'b416943e8feccbbd60d264df880d5ea42f37c54c',
'sha256': '1866e2e10264cad16644970f1bc88711886b4aed397267a1b30b3e58234f321b'},
)
_____________________________ test_content_raw_bin _____________________________
client = <django.test.client.Client object at 0x7f9ce210a358>
archive_data = <swh.web.tests.conftest._ArchiveData object at 0x7f9ce781b6a0>
@given(content_image_type())
> def test_content_raw_bin(client, archive_data, content):
swh/web/tests/browse/views/test_content.py:283:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
client = <django.test.client.Client object at 0x7f9ce210a358>
archive_data = <swh.web.tests.conftest._ArchiveData object at 0x7f9ce781b6a0>
content = {'blake2s256': 'd372bfca526245a5c11c0915b13f392121741e9762733f5a80fb2c1b10acb5e4', 'data': 'PD94bWwgdmVyc2lvbj0iMS4wIi...NSw2OS40OTggDQoJMCw0MS41OTUgMzkuNTU5LDM1Ljg0OCAiLz4NCjwvc3ZnPg0K', 'encoding': 'us-ascii', 'hljs_language': 'xml', ...}
@given(content_image_type())
def test_content_raw_bin(client, archive_data, content):
url = reverse("browse-content-raw", url_args={"query_string": content["sha1"]})
resp = client.get(url)
filename = content["path"].split("/")[-1]
content_data = archive_data.content_get_data(content["sha1"])["data"]
> assert resp.status_code == 200
E assert 500 == 200
E + where 500 = <HttpResponse status_code=500, "text/html; charset=utf-8">.status_code
swh/web/tests/browse/views/test_content.py:291: AssertionError
---------------------------------- Hypothesis ----------------------------------
Falsifying example: test_content_raw_bin(
client=<django.test.client.Client at 0x7f9ce210a358>,
archive_data=<swh.web.tests.conftest._ArchiveData at 0x7f9ce781b6a0>,
content={'blake2s256': 'd372bfca526245a5c11c0915b13f392121741e9762733f5a80fb2c1b10acb5e4',
'data': 'PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pg0KPHN2ZyB2ZXJzaW9uPSIxLjEiIGJhc2VQcm9maWxlPSJ0aW55Ij4NCjxkZWZzPg0KPC9kZWZzPg0KPHBvbHlnb24gcG9pbnRzPSI1Ny4yNSwwIDc0Ljk0MSwzNS44NDggMTE0LjUsNDEuNTk1IDg1Ljg3NSw2OS40OTggOTIuNjMzLDEwOC44OTcgNTcuMjUsOTAuMjk2IDIxLjg2OCwxMDguODk3IDI4LjYyNSw2OS40OTggDQoJMCw0MS41OTUgMzkuNTU5LDM1Ljg0OCAiLz4NCjwvc3ZnPg0K',
'encoding': 'us-ascii',
'hljs_language': 'xml',
'mimetype': 'image/svg+xml',
'path': '30f4c24c351ac28677ebe72ef2da295d6bda4ef7/Bin/fg.svg',
'sha1': '32d6be6e38481ef2340752d8fd92693b463f6736',
'sha1_git': 'ae998cd8ef33212d2dbfd8860a28c559a839d254',
'sha256': '33497bd8fc633711b5ff7c82d01f8598d5f340340a33ba28d031dc88c8a7dd7e'},
)
_________________ test_content_utf8_detected_as_binary_display _________________
client = <django.test.client.Client object at 0x7f9ce173c6a0>
archive_data = <swh.web.tests.conftest._ArchiveData object at 0x7f9ce781b6a0>
@given(content_utf8_detected_as_binary())
> def test_content_utf8_detected_as_binary_display(client, archive_data, content):
swh/web/tests/browse/views/test_content.py:401:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
swh/web/tests/browse/views/test_content.py:407: in test_content_utf8_detected_as_binary_display
assert_contains(resp, escape(content_display["content_data"]))
../../../.virtualenvs/swh/lib/python3.7/site-packages/django/test/testcases.py:446: in assertContains
response, text, status_code, msg_prefix, html)
../../../.virtualenvs/swh/lib/python3.7/site-packages/django/test/testcases.py:418: in _assert_contains
" (expected %d)" % (response.status_code, status_code)
/usr/lib/python3.7/unittest/case.py:839: in assertEqual
assertion_func(first, second, msg=msg)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <django.test.testcases.TestCase testMethod=run>, first = 500
second = 200
msg = "500 != 200 : Couldn't retrieve content: Response code was 500 (expected 200)"
def _baseAssertEqual(self, first, second, msg=None):
"""The default assertEqual implementation, not type specific."""
if not first == second:
standardMsg = '%s != %s' % _common_shorten_repr(first, second)
msg = self._formatMessage(msg, standardMsg)
> raise self.failureException(msg)
E AssertionError: 500 != 200 : Couldn't retrieve content: Response code was 500 (expected 200)
/usr/lib/python3.7/unittest/case.py:832: AssertionError
---------------------------------- Hypothesis ----------------------------------
Falsifying example: test_content_utf8_detected_as_binary_display(
client=<django.test.client.Client at 0x7f9ce173c6a0>,
archive_data=<swh.web.tests.conftest._ArchiveData at 0x7f9ce781b6a0>,
content={'blake2s256': '925bb038fec9c3f8b39aee6798f29b6103d8ae541611ff375802bce0e243234a',
'data': b"\x04\x0btypedstream\xc2\x81\x03\xc3\xa8\xc2\x84\x01@\xc2\x84\xc2\x84\xc2\x84\x0eNSIBObjectData\xc2\x81\x00\xc3\xa0\xc2\x84\xc2\x84\x08NSObject\x00\xc2\x85\xc2\x92\xc2\x84\xc2\x84\xc2\x84\x0eNSCustomObject)\xc2\x94\xc2\x84\x02@@\xc2\x84\xc2\x84\xc2\x84\x0fNSMutableString\x01\xc2\x84\xc2\x84\x08NSString\x01\xc2\x94\xc2\x84\x01+\rNSApplication\xc2\x86\xc2\x85\xc2\x86\xc2\x84\x01i\x1c\xc2\x96\xc2\x84\xc2\x84\xc2\x84\nNSMenuItem\xc2\x81\x01\xc3\xb9\xc2\x94\xc2\x92\xc2\x84\xc2\x84\xc2\x84\x06NSMenu\xc2\x81\x00\xc3\x8c\xc2\x94\xc2\x84\x04i@@@\x00\xc2\x84\xc2\x99\xc2\x99\x07SDL App\xc2\x86\xc2\x84\xc2\x84\xc2\x84\x0eNSMutableArray\x00\xc2\x84\xc2\x84\x07NSArray\x00\xc2\x94\xc2\x9a\x08\xc2\x92\xc2\x84\xc2\x9b\xc2\x92\xc2\x9c\xc2\x84\ri@@IIi@@@@:i@\x00\xc2\x84\xc2\x99\xc2\x99\rAbout SDL App\xc2\x86\xc2\x84\xc2\x99\xc2\x99\x00\xc2\x86\x00\xc2\x82\x7f\xc3\xbf\xc3\xbf\xc3\xbf\x00\xc2\x85\xc2\x84\xc2\x84\xc2\x84\x10NSCustomResource)\xc2\x94\xc2\x96\xc2\x84\xc2\x99\xc2\x99\x07NSImage\xc2\x86\xc2\x84\xc2\x99\xc2\x99\x0fNSMenuCheckmark\xc2\x86\xc2\x86\xc2\x85\xc2\x84\xc2\xa6\xc2\x96\xc2\xa7\xc2\x84\xc2\x99\xc2\x99\x10NSMenuMixedState\xc2\x86\xc2\x86\xc2\x85\x00\xc2\x85\xc2\x92\xc2\x85\xc2\x92\xc2\x85\xc2\x86\xc2\x92\xc2\x84\xc2\x9b\xc2\x92\xc2\x9c\xc2\xa0\x00\xc2\x84\xc2\x99\xc2\x99\x0ePreferences...\xc2\x86\xc2\xa4\xc2\x82\x00\x10\x00\x00\xc2\x82\x7f\xc3\xbf\xc3\xbf\xc3\xbf\x00\xc2\x85\xc2\xa5\xc2\x85\xc2\xa9\xc2\x85\x00\xc2\x85\xc2\x92\xc2\x85\xc2\x92\xc2\x85\xc2\x86\xc2\x92\xc2\x9a\xc2\x92\xc2\x84\xc2\x9b\xc2\x92\xc2\x9c\xc2\xa0\x00\xc2\x84\xc2\x99\xc2\x99\x0cHide SDL App\xc2\x86\xc2\x84\xc2\x99\xc2\x99\x01h\xc2\x86\xc2\x82\x00\x10\x00\x00\xc2\x82\x7f\xc3\xbf\xc3\xbf\xc3\xbf\x00\xc2\x85\xc2\xa5\xc2\x85\xc2\xa9\xc2\x85\x00\xc2\x85\xc2\x92\xc2\x85\xc2\x92\xc2\x85\xc2\x86\xc2\x92\xc2\x84\xc2\x9b\xc2\x92\xc2\x9c\xc2\xa0\x00\xc2\x84\xc2\x99\xc2\x99\x0bHide Others\xc2\x86\xc2\xa4\xc2\x82\x00\x10\x00\x00\xc2\x82\x7f\xc3\xbf\xc3\xbf\xc3\xbf\x00\xc2\x85\xc2\xa5\xc2\x85\xc2\xa9\xc2\x85\x00\xc2\x85\xc2\x92\xc2\x85\xc2\x92\xc2\x85\xc2\x86\xc2\x92\xc2\x84\xc2\x9b\xc2\x92\xc2\x9c\xc2\xa0\x00\xc2\x84\xc2\x99\xc2\x99\x08Show All\xc2\x86\xc2\xa4\xc2\x82\x00\x10\x00\x00\xc2\x82\x7f\xc3\xbf\xc3\xbf\xc3\xbf\x00\xc2\x85\xc2\xa5\xc2\x85\xc2\xa9\xc2\x85\x00\xc2\x85\xc2\x92\xc2\x85\xc2\x92\xc2\x85\xc2\x86\xc2\x92\xc2\x84\xc2\x9b\xc2\x92\xc2\x9c\xc2\xa0\xc2\x82@\x00\x00\x00\xc2\xa4\xc2\xa4\xc2\x82\x00\x10\x00\x00\xc2\x82\x7f\xc3\xbf\xc3\xbf\xc3\xbf\x00\xc2\x85\xc2\xa5\xc2\x85\xc2\xa9\xc2\x85\x00\xc2\x85\xc2\x92\xc2\x85\xc2\x92\xc2\x85\xc2\x86\xc2\x92\xc2\x84\xc2\x9b\xc2\x92\xc2\x9c\xc2\xa0\x00\xc2\x84\xc2\x99\xc2\x99\x0cQuit SDL App\xc2\x86\xc2\x84\xc2\x99\xc2\x99\x01q\xc2\x86\xc2\x82\x00\x10\x00\x00\xc2\x82\x7f\xc3\xbf\xc3\xbf\xc3\xbf\x00\xc2\x85\xc2\xa5\xc2\x85\xc2\xa9\xc2\x85\x00\xc2\x85\xc2\x92\xc2\x85\xc2\x92\xc2\x85\xc2\x86\xc2\x86\xc2\x84\xc2\x99\xc2\x99\x0c_NSAppleMenu\xc2\x86\xc2\x86\xc2\xa0\xc2\x82@\x00\x00\x00\xc2\xa4\xc2\xa4\xc2\x82\x00\x10\x00\x00\xc2\x82\x7f\xc3\xbf\xc3\xbf\xc3\xbf\x00\xc2\x85\xc2\xa5\xc2\x85\xc2\xa9\xc2\x85\x00\xc2\x85\xc2\x92\xc2\x85\xc2\x92\xc2\x85\xc2\x86\xc2\x9c\xc2\x96\xc2\xb5\xc2\x9c\xc2\x96\xc2\x84\xc2\x9d\xc2\x9d\x00\xc2\x84\xc2\x99\xc2\x99\x07SDLMain\xc2\x86\xc2\x84\xc2\xa0\xc2\x9a\x04\xc2\x92\xc2\x84\xc2\x9b\xc2\x92\xc2\xb9\xc2\xa0\x00\xc2\x9e\xc2\xa4\xc2\x82\x00\x10\x00\x00\xc2\x82\x7f\xc3\xbf\xc3\xbf\xc3\xbf\x00\xc2\x85\xc2\xa5\xc2\x85\xc2\xa9\xc2\x84\x0esubmenuAction:\x00\xc2\x85\xc2\x92\xc2\x85\xc2\x92\xc2\x9c\xc2\x86\xc2\x92\xc2\x84\xc2\x9b\xc2\x92\xc2\xb9\xc2\xa0\x00\xc2\x84\xc2\x99\xc2\x99\x04File\xc2\x86\xc2\xa4\xc2\x82\x00\x10\x00\x00\xc2\x82\x7f\xc3\xbf\xc3\xbf\xc3\xbf\x00\xc2\x85\xc2\xa5\xc2\x85\xc2\xa9\xc2\xa2\x00\xc2\x85\xc2\x92\xc2\x85\xc2\x92\xc2\x84\xc2\x9d\xc2\x9d\x00\xc2\x84\xc2\x98\xc2\x99\x04File\xc2\x86\xc2\x84\xc2\xa0\xc2\x9a\x05\xc2\x92\xc2\x84\xc2\x9b\xc2\x92\xc2\xbf\xc2\xa0\x00\xc2\x84\xc2\x99\xc2\x99\x08New Game\xc2\x86\xc2\x84\xc2\x99\xc2\x99\x01n\xc2\x86\xc2\x82\x00\x10\x00\x00\xc2\x82\x7f\xc3\xbf\xc3\xbf\xc3\xbf\x00\xc2\x85\xc2\xa5\xc2\x85\xc2\xa9\xc2\x85\x00\xc2\x85\xc2\x92\xc2\x85\xc2\x92\xc2\x85\xc2\x86\xc2\x92\xc2\x84\xc2\x9b\xc2\x92\xc2\xbf\xc2\xa0\x00\xc2\x84\xc2\x99\xc2\x99\x12Open Saved Game...\xc2\x86\xc2\x84\xc2\x99\xc2\x99\x01o\xc2\x86\xc2\x82\x00\x10\x00\x00\xc2\x82\x7f\xc3\xbf\xc3\xbf\xc3\xbf\x00\xc2\x85\xc2\xa5\xc2\x85\xc2\xa9\xc2\x85\x00\xc2\x85\xc2\x92\xc2\x85\xc2\x92\xc2\x85\xc2\x86\xc2\x92\xc2\x84\xc2\x9b\xc2\x92\xc2\xbf\xc2\xa0\xc2\x82@\x00\x00\x00\xc2\xa4\xc2\xa4\xc2\x82\x00\x10\x00\x00\xc2\x82\x7f\xc3\xbf\xc3\xbf\xc3\xbf\x00\xc2\x85\xc2\xa5\xc2\x85\xc2\xa9\xc2\x85\x00\xc2\x85\xc2\x92\xc2\x85\xc2\x92\xc2\x85\xc2\x86\xc2\x92\xc2\x84\xc2\x9b\xc2\x92\xc2\xbf\xc2\xa0\x00\xc2\x84\xc2\x99\xc2\x99\tSave Game\xc2\x86\xc2\x84\xc2\x99\xc2\x99\x01s\xc2\x86\xc2\x82\x00\x10\x00\x00\xc2\x82\x7f\xc3\xbf\xc3\xbf\xc3\xbf\x00\xc2\x85\xc2\xa5\xc2\x85\xc2\xa9\xc2\x85\x00\xc2\x85\xc2\x92\xc2\x85\xc2\x92\xc2\x85\xc2\x86\xc2\x92\xc2\x84\xc2\x9b\xc2\x92\xc2\xbf\xc2\xa0\x00\xc2\x84\xc2\x99\xc2\x99\x0fSave Game As...\xc2\x86\xc2\x84\xc2\x99\xc2\x99\x01S\xc2\x86\xc2\x82\x00\x10\x00\x00\xc2\x82\x7f\xc3\xbf\xc3\xbf\xc3\xbf\x00\xc2\x85\xc2\xa5\xc2\x85\xc2\xa9\xc2\x85\x00\xc2\x85\xc2\x92\xc2\x85\xc2\x92\xc2\x85\xc2\x86\xc2\x86\xc2\x85\xc2\x86\xc2\x86\xc2\x92\xc2\x84\xc2\x9b\xc2\x92\xc2\xb9\xc2\xa0\x00\xc2\x84\xc2\x99\xc2\x99\x06Window\xc2\x86\xc2\xa4\xc2\x82\x00\x10\x00\x00\xc2\x82\x7f\xc3\xbf\xc3\xbf\xc3\xbf\x00\xc2\x85\xc2\xa5\xc2\x85\xc2\xa9\xc2\xa2\x00\xc2\x85\xc2\x92\xc2\x85\xc2\x92\xc2\x84\xc2\x9d\xc2\x9d\x00\xc2\x84\xc2\x98\xc2\x99\x06Window\xc2\x86\xc2\x84\xc2\xa0\xc2\x9a\x01\xc2\x92\xc2\x84\xc2\x9b\xc2\x92\xc3\x91\xc2\xa0\x00\xc2\x84\xc2\x99\xc2\x99\x08Minimize\xc2\x86\xc2\x84\xc2\x99\xc2\x99\x01m\xc2\x86\xc2\x82\x00\x10\x00\x00\xc2\x82\x7f\xc3\xbf\xc3\xbf\xc3\xbf\x00\xc2\x85\xc2\xa5\xc2\x85\xc2\xa9\xc2\x85\x00\xc2\x85\xc2\x92\xc2\x85\xc2\x92\xc2\x85\xc2\x86\xc2\x86\xc2\x84\xc2\x99\xc2\x99\x0e_NSWindowsMenu\xc2\x86\xc2\x86\xc2\x86\xc2\x92\xc2\x84\xc2\x9b\xc2\x92\xc2\xb9\xc2\xa0\x00\xc2\x84\xc2\x99\xc2\x99\x04Help\xc2\x86\xc2\xa4\xc2\x82\x00\x10\x00\x00\xc2\x82\x7f\xc3\xbf\xc3\xbf\xc3\xbf\x00\xc2\x85\xc2\xa5\xc2\x85\xc2\xa9\xc2\xa2\x00\xc2\x85\xc2\x92\xc2\x85\xc2\x92\xc2\x84\xc2\x9d\xc2\x9d\x00\xc2\x84\xc2\x98\xc2\x99\x04Help\xc2\x86\xc2\x84\xc2\xa0\xc2\x9a\x01\xc2\x92\xc2\x84\xc2\x9b\xc2\x92\xc3\x9a\xc2\xa0\x00\xc2\x84\xc2\x99\xc2\x99\x08SDL Help\xc2\x86\xc2\x84\xc2\x99\xc2\x99\x01?\xc2\x86\xc2\x82\x00\x10\x00\x00\xc2\x82\x7f\xc3\xbf\xc3\xbf\xc3\xbf\x00\xc2\x85\xc2\xa5\xc2\x85\xc2\xa9\xc2\x85\x00\xc2\x85\xc2\x92\xc2\x85\xc2\x92\xc2\x85\xc2\x86\xc2\x86\xc2\x85\xc2\x86\xc2\x86\xc2\x86\xc2\x84\xc2\x99\xc2\x99\x0b_NSMainMenu\xc2\x86\xc2\x86\xc2\x95\xc2\x96\xc2\xb2\xc2\x9c\xc2\x96\xc2\x84\xc2\x96\xc2\x96\xc2\x84\xc2\x99\xc2\x99\x07SDLMain\xc2\x86\xc2\x85\xc2\x86\xc2\x95\xc2\x96\xc3\x82\xc2\xbf\xc2\x96\xc2\xbf\xc2\xbd\xc2\x96\xc2\x84\xc2\x96\xc2\x96\xc2\x84\xc2\x99\xc2\x99\rNSFontManager\xc2\x86\xc2\x85\xc2\x86\xc2\x95\xc2\x96\xc2\xad\xc2\x9c\xc2\x96\xc3\x8f\xc2\xb9\xc2\x96\xc3\x8c\xc2\xbf\xc2\x96\xc2\xb0\xc2\x9c\xc2\x96\xc2\x84\xc2\x9b\xc2\x92\xc2\x85\xc2\xa0\x00\xc2\x84\xc2\x99\xc2\x99\x04Game\xc2\x86\xc2\xa4\xc2\x82\x00\x10\x00\x00\xc2\x82\x7f\xc3\xbf\xc3\xbf\xc3\xbf\x00\xc2\x85\xc2\xa5\xc2\x85\xc2\xa9\xc2\xa2\x00\xc2\x85\xc2\x92\xc2\x85\xc2\x92\xc2\x84\xc2\x9d\xc2\x9d\x00\xc3\xa6\xc2\x84\xc2\xa0\xc2\x9a\x03\xc2\x92\xc2\x84\xc2\x9b\xc2\x92\xc3\xa7\xc2\xa0\x00\xc2\x84\xc2\x99\xc2\x99\x08New Game\xc2\x86\xc2\xa4\xc2\x82\x00\x10\x00\x00\xc2\x82\x7f\xc3\xbf\xc3\xbf\xc3\xbf\x00\xc2\x85\xc2\xa5\xc2\x85\xc2\xa9\xc2\x85\x00\xc2\x85\xc2\x92\xc2\x85\xc2\x92\xc2\x85\xc2\x86\xc2\x92\xc2\x84\xc2\x9b\xc2\x92\xc3\xa7\xc2\xa0\x00\xc2\x84\xc2\x99\xc2\x99\tSave Game\xc2\x86\xc2\xa4\xc2\x82\x00\x10\x00\x00\xc2\x82\x7f\xc3\xbf\xc3\xbf\xc3\xbf\x00\xc2\x85\xc2\xa5\xc2\x85\xc2\xa9\xc2\x85\x00\xc2\x85\xc2\x92\xc2\x85\xc2\x92\xc2\x85\xc2\x86\xc2\x92\xc2\x84\xc2\x9b\xc2\x92\xc3\xa7\xc2\xa0\x00\xc2\x84\xc2\x99\xc2\x99\x04Blue\xc2\x86\xc2\xa4\xc2\x82\x00\x10\x00\x00\xc2\x82\x7f\xc3\xbf\xc3\xbf\xc3\xbf\x01\xc2\x85\xc2\xa5\xc2\x85\xc2\xa9\xc2\x85\x00\xc2\x85\xc2\x92\xc2\x85\xc2\x92\xc2\x85\xc2\x86\xc2\x86\xc2\x85\xc2\x86\xc2\x86\xc2\xb9\xc2\x96\xc3\x9a\xc3\x98\xc2\x96\xc2\xa2\xc2\x9c\xc2\x96\xc3\x94\xc3\x91\xc2\x96\xc2\xb4\xc2\x9c\xc2\x96\xc2\xab\xc2\x9c\xc2\x96\xc2\x9c\xc2\xbc\xc2\x96\xc2\xbc\xc2\xb9\xc2\x96\xc3\x89\xc2\xbf\xc2\x96\xc3\x88\xc2\xbf\xc2\x96\xc3\x9d\xc3\x9a\xc2\x96\xc3\x85\xc2\xbf\xc2\x96\xc3\x98\xc2\xb9\xc2\x96\xc3\x91\xc3\x8f\xc2\x96\xc2\x84\xc2\x9b\xc2\x92\xc2\x85\xc2\xa0\x00\xc2\x84\xc2\x99\xc2\x99\x0bOpen Recent\xc2\x86\xc2\xa4\xc2\x82\x00\x10\x00\x00\xc2\x82\x7f\xc3\xbf\xc3\xbf\xc3\xbf\x00\xc2\x85\xc2\xa5\xc2\x85\xc2\xa9\xc2\xa2\x00\xc2\x85\xc2\x92\xc2\x85\xc2\x92\xc2\x84\xc2\x9d\xc2\x9d\x00\xc2\x84\xc2\x98\xc2\x99\x0bOpen Recent\xc2\x86\xc2\x84\xc2\xa0\xc2\x9a\x01\xc2\x92\xc2\x84\xc2\x9b\xc2\x92\xc3\xb1\xc2\xa0\x00\xc2\x84\xc2\x99\xc2\x99\nClear Menu\xc2\x86\xc2\xa4\xc2\x82\x00\x10\x00\x00\xc2\x82\x7f\xc3\xbf\xc3\xbf\xc3\xbf\x00\xc2\x85\xc2\xa5\xc2\x85\xc2\xa9\xc2\x85\x00\xc2\x85\xc2\x92\xc2\x85\xc2\x92\xc2\x85\xc2\x86\xc2\x86\xc2\x84\xc2\x99\xc2\x99\x16_NSRecentDocumentsMenu\xc2\x86\xc2\x86\xc2\x86\xc2\xbf\xc2\x96\xc2\xbd\xc2\xb9\xc2\x9a\x0c\xc2\x96\xc2\x95\xc2\x84\xc2\x98\xc2\x99\x0cFile's Owner\xc2\x86\xc2\x96\xc2\xb5\xc2\x84\xc2\x99\xc2\x99\x041111\xc2\x86\xc2\x96\xc3\xa1\xc3\xa2\xc2\x96\xc2\xb9\xc2\x84\xc2\x98\xc2\x99\x08MainMenu\xc2\x86\xc2\x96\xc2\x9a\xc2\x84\xc2\x99\xc2\x99\nNSMenuItem\xc2\x86\xc2\x96\xc3\x94\xc2\x84\xc2\x99\xc2\x99\x0bNSMenuItem1\xc2\x86\xc2\x96\xc3\x98\xc2\x84\xc2\x98\xc2\x99\x011\xc2\x86\xc2\x96\xc3\x8f\xc2\x84\xc2\x99\xc2\x99\x0bNSMenuItem1\xc2\x86\xc2\x96\xc3\x9d\xc2\x84\xc2\x98\xc2\x99\x00\xc2\x86\xc2\x96\xc3\x9a\xc2\x84\xc2\x98\xc2\x99\x012\xc2\x86\xc2\x96\xc3\xa3\xc2\x84\xc2\x99\xc2\x99\x0cFont Manager\xc2\x86\xc2\x96\xc3\x91\xc2\x84\xc2\x99\xc2\x99\x06NSMenu\xc2\x86\xc2\x92\xc2\x84\xc2\x84\xc2\x84\x0cNSMutableSet\x00\xc2\x84\xc2\x84\x05NSSet\x00\xc2\x94\xc2\x84\x01I\x00\xc2\x86\xc2\x92\xc2\x84\xc2\xa0\xc2\x9a\r\xc2\x92\xc2\x84\xc2\x84\xc2\x84\x15NSNibControlConnector\xc2\x81\x00\xc3\x8f\xc2\x84\xc2\x84\x0eNSNibConnector\x11\xc2\x94\xc2\x84\x03@@@\xc2\xa2\xc2\x95\xc2\x84\xc2\x98\xc2\x99\x1dorderFrontStandardAboutPanel:\xc2\x86\xc2\x86\xc2\x92\xc2\x84\x07\xc2\xa8\xc2\xb0\xc2\x95\xc2\x84\xc2\x99\xc2\x99\x16hideOtherApplications:\xc2\x86\xc2\x86\xc2\x92\xc2\x84\x07\xc2\xa8\xc2\xad\xc2\x95\xc2\x84\xc2\x99\xc2\x99\x05hide:\xc2\x86\xc2\x86\xc2\x92\xc2\x84\x07\xc2\xa8\xc2\xb2\xc2\x95\xc2\x84\xc2\x99\xc2\x99\x16unhideAllApplications:\xc2\x86\xc2\x86\xc2\x92\xc2\x84\xc2\x84\xc2\x84\x14NSNibOutletConnector\xc2\x81\x00\xc3\x8f\x08\xc2\xa8\xc2\x95\xc3\xa1\xc2\x84\xc2\x99\xc2\x99\x08delegate\xc2\x86\xc2\x86\xc2\x92\xc2\x84\x07\xc2\xa8\xc3\x94\xc2\x85\xc2\x84\xc2\x98\xc2\x99\x13performMiniaturize:\xc2\x86\xc2\x86\xc2\x92\xc2\x84\x07\xc2\xa8\xc2\xb5\xc2\x85\xc2\x84\xc2\x99\xc2\x99\nterminate:\xc2\x86\xc2\x86\xc2\x92\xc2\x84\x07\xc2\xa8\xc3\x82\xc3\xa1\xc2\x84\xc2\x99\xc2\x99\x07newGame\xc2\x86\xc2\x86\xc2\x92\xc2\x84\x07\xc2\xa8\xc3\x85\xc3\xa1\xc2\x84\xc2\x99\xc2\x99\x08openGame\xc2\x86\xc2\x86\xc2\x92\xc2\x84\x07\xc2\xa8\xc3\x89\xc3\xa1\xc2\x84\xc2\x99\xc2\x99\x08saveGame\xc2\x86\xc2\x86\xc2\x92\xc2\x84\x07\xc2\xa8\xc3\x8c\xc3\xa1\xc2\x84\xc2\x99\xc2\x99\nsaveGameAs\xc2\x86\xc2\x86\xc2\x92\xc2\x84\x07\xc2\xa8\xc3\x9d\xc3\xa1\xc2\x84\xc2\x99\xc2\x99\x04help\xc2\x86\xc2\x86\xc2\x92\xc2\x84\x07\xc2\xa8\xc2\xab\xc3\xa1\xc2\x84\xc2\x99\xc2\x99\tprefsMenu\xc2\x86\xc2\x86\xc2\x86\xc2\x92\xc3\xa3\xc2\x9a*\xc2\x84\x02@i\xc2\xb9\x1d\xc2\xaa\xc2\x95\x01\xc2\xaa\xc2\x9a\xc2\x81\x00\xc3\x84\xc2\xaa\xc2\xb2\xc2\x81\x00\xc2\x96\xc2\xaa\xc2\xb5\xc2\x81\x00\xc2\x88\xc2\xaa\xc3\x94\xc2\x81\x01\x1b\xc2\xaa\xc3\xa1\xc2\x81\x00\xc3\x82\xc2\xaa\x1f\xc2\x81\x01D\xc2\xaa\x1b\xc2\x81\x01B\xc2\xaa\x0c\xc2\x81\x00\xc2\x98\xc2\xaa\x0e\xc2\x81\x00\xc2\x99\xc2\xaa\xc2\xb0\xc2\x81\x00\xc2\x91\xc2\xaa\xc2\xbd\xc2\x81\x012\xc2\xaa\xc3\x82\xc2\x81\x01:\xc2\xaa\xc3\xa3\xc2\x81\x00\xc3\xbd\xc2\xaa\x06\xc2\x81\x00\xc2\x8e\xc2\xaa\x17\xc2\x81\x01@\xc2\xaa\x19\xc2\x81\x01A\xc2\xaa\xc3\x85\xc2\x81\x01.\xc2\xaa\xc3\x9aj\xc2\xaa\xc3\x8c\xc2\x81\x017\xc2\xaa\xc2\xab\xc2\x81\x01%\xc2\xaa\xc2\xbf\xc2\x81\x018\xc2\xaa!\xc2\x81\x01E\xc2\xaa\xc3\x8f\xc2\x81\x01\x1c\xc2\xaa\xc3\x88\xc2\x81\x013\xc2\xaa\xc3\x89\xc2\x81\x015\xc2\xaa\xc3\x9do\xc2\xaa\x10\xc2\x81\x00\xc3\x83\xc2\xaa\xc2\xb4\xc2\x81\x00\xc2\x95\xc2\xaa\x13\xc2\x81\x01 \xc2\xaa\n\xc2\x81\x00\xc2\x92\xc2\xaa\xc3\x98g\xc2\xaa\xc2\x9c9\xc2\xaa\xc3\xa5\xc2\x81\x01'\xc2\xaa\x1d\xc2\x81\x01C\xc2\xaa\xc3\x91\xc2\x81\x01\x1d\xc2\xaa\xc2\xa2:\xc2\xaa\xc2\xad\xc2\x81\x00\xc2\x86\xc2\xaa\xc2\xbc8\xc2\xaa\x15\xc2\x81\x01$\xc2\xaa\xc3\xaf\xc2\x81\x011\xc2\x9a\xc2\x81\x01F\xc2\x9a\x00\xc2\x92\xc2\x84\xc2\x98\xc2\x99\x10IBCocoaFramework\xc2\x86\xc2\x86",
'encoding': 'binary',
'hljs_language': 'nohighlight',
'mimetype': 'application/octet-stream',
'path': 'a7f3e08d43f514a87888b6cdcfe9f7f09ca081ae/Build/Xcode/English.lproj/SDLMain.nib/objects.nib',
'sha1': '6f96ed421922b43c81d2e41a5448ac56c778639a',
'sha1_git': '637801528a03f85f28a290e5ffde3716217cd1e8',
'sha256': '56dee1266a299599c4d73ee85a08942d6b2bf7fd4530a2013437f9237c0ef163'},
)
__________________ test_content_origin_snapshot_branch_browse __________________
client = <django.test.client.Client object at 0x7f9ce17ccda0>
archive_data = <swh.web.tests.conftest._ArchiveData object at 0x7f9ce781b6a0>
@given(origin_with_multiple_visits())
> def test_content_origin_snapshot_branch_browse(client, archive_data, origin):
swh/web/tests/browse/views/test_content.py:411:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
client = <django.test.client.Client object at 0x7f9ce17ccda0>
archive_data = <swh.web.tests.conftest._ArchiveData object at 0x7f9ce781b6a0>
origin = {'archives': ['highlightjs-line-numbers.js.zip', 'highlightjs-line-numbers.js_visit2.zip'], 'type': 'git', 'url': 'https://github.com/wcoder/highlightjs-line-numbers.js'}
@given(origin_with_multiple_visits())
def test_content_origin_snapshot_branch_browse(client, archive_data, origin):
visits = archive_data.origin_visit_get(origin["url"])
visit = random.choice(visits)
snapshot = archive_data.snapshot_get(visit["snapshot"])
branches, releases = process_snapshot_branches(snapshot)
branch_info = random.choice(branches)
directory = archive_data.revision_get(branch_info["revision"])["directory"]
directory_content = archive_data.directory_ls(directory)
directory_file = random.choice(
[e for e in directory_content if e["type"] == "file"]
)
url = reverse(
"browse-content",
url_args={"query_string": directory_file["checksums"]["sha1"]},
query_params={
"origin_url": origin["url"],
"snapshot": snapshot["id"],
"branch": branch_info["name"],
"path": directory_file["name"],
},
)
resp = client.get(url)
> assert resp.status_code == 200
E assert 500 == 200
E + where 500 = <HttpResponse status_code=500, "text/html; charset=utf-8">.status_code
swh/web/tests/browse/views/test_content.py:436: AssertionError
---------------------------------- Hypothesis ----------------------------------
Falsifying example: test_content_origin_snapshot_branch_browse(
client=<django.test.client.Client at 0x7f9ce17ccda0>,
archive_data=<swh.web.tests.conftest._ArchiveData at 0x7f9ce781b6a0>,
origin={'archives': ['highlightjs-line-numbers.js.zip',
'highlightjs-line-numbers.js_visit2.zip'],
'type': 'git',
'url': 'https://github.com/wcoder/highlightjs-line-numbers.js'},
)
_________________ test_content_origin_snapshot_release_browse __________________
client = <django.test.client.Client object at 0x7f9ce315e828>
archive_data = <swh.web.tests.conftest._ArchiveData object at 0x7f9ce781b6a0>
@given(origin_with_multiple_visits())
> def test_content_origin_snapshot_release_browse(client, archive_data, origin):
swh/web/tests/browse/views/test_content.py:477:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
client = <django.test.client.Client object at 0x7f9ce315e828>
archive_data = <swh.web.tests.conftest._ArchiveData object at 0x7f9ce781b6a0>
origin = {'archives': ['highlightjs-line-numbers.js.zip', 'highlightjs-line-numbers.js_visit2.zip'], 'type': 'git', 'url': 'https://github.com/wcoder/highlightjs-line-numbers.js'}
@given(origin_with_multiple_visits())
def test_content_origin_snapshot_release_browse(client, archive_data, origin):
visits = archive_data.origin_visit_get(origin["url"])
visit = random.choice(visits)
snapshot = archive_data.snapshot_get(visit["snapshot"])
branches, releases = process_snapshot_branches(snapshot)
release_info = random.choice(releases)
directory_content = archive_data.directory_ls(release_info["directory"])
directory_file = random.choice(
[e for e in directory_content if e["type"] == "file"]
)
url = reverse(
"browse-content",
url_args={"query_string": directory_file["checksums"]["sha1"]},
query_params={
"origin_url": origin["url"],
"snapshot": snapshot["id"],
"release": release_info["name"],
"path": directory_file["name"],
},
)
resp = client.get(url)
> assert resp.status_code == 200
E assert 500 == 200
E + where 500 = <HttpResponse status_code=500, "text/html; charset=utf-8">.status_code
swh/web/tests/browse/views/test_content.py:501: AssertionError
---------------------------------- Hypothesis ----------------------------------
Falsifying example: test_content_origin_snapshot_release_browse(
client=<django.test.client.Client at 0x7f9ce315e828>,
archive_data=<swh.web.tests.conftest._ArchiveData at 0x7f9ce781b6a0>,
origin={'archives': ['highlightjs-line-numbers.js.zip',
'highlightjs-line-numbers.js_visit2.zip'],
'type': 'git',
'url': 'https://github.com/wcoder/highlightjs-line-numbers.js'},
)
___________________________ test_legacy_swhid_browse ___________________________
archive_data = <swh.web.tests.conftest._ArchiveData object at 0x7f9ce781b6a0>
client = <django.test.client.Client object at 0x7f9ce5df84e0>
@given(origin())
> def test_legacy_swhid_browse(archive_data, client, origin):
swh/web/tests/browse/views/test_identifiers.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
swh/web/tests/browse/views/test_identifiers.py:201: in test_legacy_swhid_browse
assert_contains(resp, swhid)
../../../.virtualenvs/swh/lib/python3.7/site-packages/django/test/testcases.py:446: in assertContains
response, text, status_code, msg_prefix, html)
../../../.virtualenvs/swh/lib/python3.7/site-packages/django/test/testcases.py:418: in _assert_contains
" (expected %d)" % (response.status_code, status_code)
/usr/lib/python3.7/unittest/case.py:839: in assertEqual
assertion_func(first, second, msg=msg)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <django.test.testcases.TestCase testMethod=run>, first = 500
second = 200
msg = "500 != 200 : Couldn't retrieve content: Response code was 500 (expected 200)"
def _baseAssertEqual(self, first, second, msg=None):
"""The default assertEqual implementation, not type specific."""
if not first == second:
standardMsg = '%s != %s' % _common_shorten_repr(first, second)
msg = self._formatMessage(msg, standardMsg)
> raise self.failureException(msg)
E AssertionError: 500 != 200 : Couldn't retrieve content: Response code was 500 (expected 200)
/usr/lib/python3.7/unittest/case.py:832: AssertionError
---------------------------------- Hypothesis ----------------------------------
Falsifying example: test_legacy_swhid_browse(
archive_data=<swh.web.tests.conftest._ArchiveData at 0x7f9ce781b6a0>,
client=<django.test.client.Client at 0x7f9ce5df84e0>,
origin={'archives': ['highlightjs-line-numbers.js.zip',
'highlightjs-line-numbers.js_visit2.zip'],
'type': 'git',
'url': 'https://github.com/wcoder/highlightjs-line-numbers.js'},
)
___________________________ test_origin_content_view ___________________________
client = <django.test.client.Client object at 0x7f9ce0f57c18>
archive_data = <swh.web.tests.conftest._ArchiveData object at 0x7f9ce781b6a0>
@given(origin_with_multiple_visits())
> def test_origin_content_view(client, archive_data, origin):
swh/web/tests/browse/views/test_origin.py:74:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
swh/web/tests/browse/views/test_origin.py:103: in test_origin_content_view
tdata["content"],
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
client = <django.test.client.Client object at 0x7f9ce0f57c18>
archive_data = <swh.web.tests.conftest._ArchiveData object at 0x7f9ce781b6a0>
origin_info = {'archives': ['highlightjs-line-numbers.js.zip', 'highlightjs-line-numbers.js_visit2.zip'], 'type': 'git', 'url': 'https://github.com/wcoder/highlightjs-line-numbers.js'}
origin_visit = {'date': '2020-10-02T11:24:28.095210+00:00', 'metadata': {}, 'origin': 'https://github.com/wcoder/highlightjs-line-numbers.js', 'snapshot': 'da8abf3ec5203afa1561754a041aca64d7580ec2', ...}
origin_branches = [{'date': '18 December 2018, 19:31 UTC', 'directory': '5b61d50ef35ca9a4618a3572bde947b8cccf71ad', 'message': 'Merge pu...ca09d659cc07ad2eb4a119ab6ec49efd0c113e35', 'message': 'Fixed url\n', 'name': 'refs/remotes/origin/gh-pages', ...}, ...]
origin_releases = [{'branch_name': 'refs/tags/v2.0.0', 'date': '31 May 2017, 22:54 UTC', 'directory': 'f56e2d15416d5f2756310daae3fda26d6... UTC', 'directory': '5b61d50ef35ca9a4618a3572bde947b8cccf71ad', 'id': '6877028d6e5412780517d0bfa81f07f6c51abb41', ...}]
root_dir_sha1 = '5b61d50ef35ca9a4618a3572bde947b8cccf71ad'
content = {'blake2s256': '10e9d3d9d26d71d1c50c74b1c7f215cefadd74bd421b29ed76bd0fd2a4801941', 'data': 'var gulp = require(\'gulp\...\n }))\n .pipe(gulp.dest(\'dist\'));\n});\n', 'encoding': 'us-ascii', 'hljs_language': 'javascript', ...}
visit_id = 2, timestamp = None, snapshot_id = None
def _origin_content_view_test_helper(
client,
archive_data,
origin_info,
origin_visit,
origin_branches,
origin_releases,
root_dir_sha1,
content,
visit_id=None,
timestamp=None,
snapshot_id=None,
):
content_path = "/".join(content["path"].split("/")[1:])
if not visit_id and not snapshot_id:
visit_id = origin_visit["visit"]
query_params = {"origin_url": origin_info["url"], "path": content_path}
if timestamp:
query_params["timestamp"] = timestamp
if visit_id:
query_params["visit_id"] = visit_id
elif snapshot_id:
query_params["snapshot"] = snapshot_id
url = reverse("browse-origin-content", query_params=query_params)
resp = client.get(url)
> assert resp.status_code == 200
E assert 500 == 200
E + where 500 = <HttpResponse status_code=500, "text/html; charset=utf-8">.status_code
swh/web/tests/browse/views/test_origin.py:850: AssertionError
---------------------------------- Hypothesis ----------------------------------
Falsifying example: test_origin_content_view(
client=<django.test.client.Client at 0x7f9ce0f57c18>,
archive_data=<swh.web.tests.conftest._ArchiveData at 0x7f9ce781b6a0>,
origin={'archives': ['highlightjs-line-numbers.js.zip',
'highlightjs-line-numbers.js_visit2.zip'],
'type': 'git',
'url': 'https://github.com/wcoder/highlightjs-line-numbers.js'},
)
=============================== warnings summary ===============================
swh/web/tests/data.py:183
swh/web/tests/data.py:183
swh/web/tests/data.py:183
swh/web/tests/data.py:183
/home/anlambert/swh/swh-environment/swh-web/swh/web/tests/data.py:183: DeprecationWarning: Call to deprecated class SWHConfig. (Use swh.core.config.load_from_envvar instead) -- Deprecated since version 0.3.2.
config=_TEST_LOADER_CONFIG,
swh/web/tests/data.py:316
swh/web/tests/data.py:316
swh/web/tests/data.py:316
/home/anlambert/swh/swh-environment/swh-web/swh/web/tests/data.py:316: DeprecationWarning: Call to deprecated class SWHConfig. (Use swh.core.config.load_from_envvar instead) -- Deprecated since version 0.3.2.
idx = idx_class()
../../../.virtualenvs/swh/lib/python3.7/copyreg.py:88
../../../.virtualenvs/swh/lib/python3.7/copyreg.py:88
../../../.virtualenvs/swh/lib/python3.7/copyreg.py:88
swh/web/tests/admin/test_origin_save.py::test_add_authorized_origin_url
swh/web/tests/admin/test_origin_save.py::test_add_authorized_origin_url
swh/web/tests/admin/test_origin_save.py::test_add_authorized_origin_url
/home/anlambert/.virtualenvs/swh/lib/python3.7/copyreg.py:88: DeprecationWarning: Call to deprecated class SWHConfig. (Use swh.core.config.load_from_envvar instead) -- Deprecated since version 0.3.2.
return cls.__new__(cls, *args)
-- Docs: https://docs.pytest.org/en/stable/warnings.html
=========================== short test summary info ============================
FAILED swh/web/tests/api/views/test_content.py::test_api_content_license_sha_not_found
FAILED swh/web/tests/browse/views/test_content.py::test_content_view_text - a...
FAILED swh/web/tests/browse/views/test_content.py::test_content_view_text_no_highlight
FAILED swh/web/tests/browse/views/test_content.py::test_content_view_no_utf8_text
FAILED swh/web/tests/browse/views/test_content.py::test_content_view_image - ...
FAILED swh/web/tests/browse/views/test_content.py::test_content_view_image_no_rendering
FAILED swh/web/tests/browse/views/test_content.py::test_content_view_text_with_path
FAILED swh/web/tests/browse/views/test_content.py::test_content_raw_text - as...
FAILED swh/web/tests/browse/views/test_content.py::test_content_raw_no_utf8_text
FAILED swh/web/tests/browse/views/test_content.py::test_content_raw_bin - ass...
FAILED swh/web/tests/browse/views/test_content.py::test_content_utf8_detected_as_binary_display
FAILED swh/web/tests/browse/views/test_content.py::test_content_origin_snapshot_branch_browse
FAILED swh/web/tests/browse/views/test_content.py::test_content_origin_snapshot_release_browse
FAILED swh/web/tests/browse/views/test_identifiers.py::test_legacy_swhid_browse
FAILED swh/web/tests/browse/views/test_origin.py::test_origin_content_view - ...
=========== 15 failed, 437 passed, 7 skipped, 13 warnings in 17.18s ============