api_client = <rest_framework.test.APIClient object at 0x7f8690b630f0>
content = {'blake2s256': 'c6518d8e2ceb0ec1c45e4ebfc626a1ff8216e6e1a9d0b2fdbaeea8fa209c275f', 'data': '/*\n** SGI FREE SOFTWARE L...lse\nvoid tessMeshCheckMesh( TESSmesh *mesh );\n#endif\n\n#endif\n', 'encoding': 'us-ascii', 'hljs_language': 'c', ...}
directory = 'e34b4b770ac7e0976a6d4a37c62e2ecce5029ec2'
release = '85a96217a3897dd1bcce9df77b1968fc864e3c1e'
revision = '9e7d024aed197e48ed2d7594275e9db73ac2ade5'
snapshot = 'da8abf3ec5203afa1561754a041aca64d7580ec2'
def test_api_known_swhid_all_present(
api_client, content, directory, release, revision, snapshot
):
input_swhids = [
gen_swhid(ObjectType.CONTENT, content["sha1_git"]),
gen_swhid(ObjectType.DIRECTORY, directory),
gen_swhid(ObjectType.REVISION, revision),
gen_swhid(ObjectType.RELEASE, release),
gen_swhid(ObjectType.SNAPSHOT, snapshot),
]
url = reverse("api-1-known")
> resp = check_api_post_responses(api_client, url, data=input_swhids, status_code=200)
.tox/py3/lib/python3.7/site-packages/swh/web/tests/api/views/test_identifiers.py:110:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.7/site-packages/swh/web/tests/utils.py:186: in check_api_post_responses
api_client, url, status_code, content_type="application/json", data=data
.tox/py3/lib/python3.7/site-packages/swh/web/tests/utils.py:163: in check_api_post_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/identifiers.py", line 116, in api_swhid_known
E for hash in missing_hashes.iter():
E AttributeError: 'set' object has no attribute 'iter'
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 7 2022, 7:43 PM