Page MenuHomeSoftware Heritage

Jenkins > .tox.py3.lib.python3.7.site-packages.swh.deposit.tests.api.test_deposit_private_read_archive::test_access_to_existing_deposit_with_multiple_archives
Failed

TEST RESULT

Run At
Sep 17 2020, 7:50 PM
Details
tmp_path = '/tmp/pytest-of-jenkins/pytest-0/test_access_to_existing_deposi1' authenticated_client = <rest_framework.test.APIClient object at 0x7fa66eeeed68> deposit_collection = <DepositCollection: {'id': 55, 'name': 'test'}> partial_deposit = <Deposit: {'id': 43, 'reception_date': datetime.datetime(2020, 9, 17, 17, 49, 29, 329092, tzinfo=<UTC>), 'collection': 'test', 'external_id': 'external-id-partial', 'client': 'test', 'status': 'partial'}> sample_archive = {'data': b'PK\x03\x04\x14\x00\x00\x00\x00\x00.\x8e1Q\xcba\xb4c\x14\x00\x00\x00\x14\x00\x00\x00\x05\x00\x00\x00file1som...ytest-0/test_access_to_existing_deposi1/tmp9w_nn_q_', 'length': 128, 'md5sum': '39e8bd65bf8f0eb04eeed3f16943a4e9', ...} def test_access_to_existing_deposit_with_multiple_archives( tmp_path, authenticated_client, deposit_collection, partial_deposit, sample_archive ): """Access to deposit should stream a 200 response with its raw contents """ deposit = partial_deposit archive2 = create_arborescence_archive( tmp_path, "archive2", "file2", b"some other content in file" ) # Add a second archive to deposit update_uri = reverse(EM_IRI, args=[deposit_collection.name, deposit.id]) response = authenticated_client.post( update_uri, content_type="application/zip", # as zip data=archive2["data"], # + headers CONTENT_LENGTH=archive2["length"], HTTP_SLUG=deposit.external_id, HTTP_CONTENT_MD5=archive2["md5sum"], HTTP_PACKAGING="http://purl.org/net/sword/package/SimpleZip", HTTP_IN_PROGRESS="false", HTTP_CONTENT_DISPOSITION="attachment; filename=%s" % (archive2["name"],), ) assert response.status_code == status.HTTP_201_CREATED for url in private_get_raw_url_endpoints(deposit_collection, deposit): > r = authenticated_client.get(url) .tox/py3/lib/python3.7/site-packages/swh/deposit/tests/api/test_deposit_private_read_archive.py:76: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/py3/lib/python3.7/site-packages/rest_framework/test.py:286: in get response = super().get(path, data=data, **extra) .tox/py3/lib/python3.7/site-packages/rest_framework/test.py:203: in get return self.generic('GET', path, **r) .tox/py3/lib/python3.7/site-packages/rest_framework/test.py:232: in generic method, path, data, content_type, secure, **extra) .tox/py3/lib/python3.7/site-packages/django/test/client.py:422: in generic return self.request(**r) .tox/py3/lib/python3.7/site-packages/rest_framework/test.py:283: in request return super().request(**kwargs) .tox/py3/lib/python3.7/site-packages/rest_framework/test.py:235: in request request = super().request(**kwargs) .tox/py3/lib/python3.7/site-packages/django/test/client.py:503: in request raise exc_value .tox/py3/lib/python3.7/site-packages/django/core/handlers/exception.py:34: in inner response = get_response(request) .tox/py3/lib/python3.7/site-packages/django/core/handlers/base.py:115: in _get_response response = self.process_exception_by_middleware(e, request) .tox/py3/lib/python3.7/site-packages/django/core/handlers/base.py:113: in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) .tox/py3/lib/python3.7/site-packages/django/views/decorators/csrf.py:54: in wrapped_view return view_func(*args, **kwargs) .tox/py3/lib/python3.7/site-packages/django/views/generic/base.py:71: in view return self.dispatch(request, *args, **kwargs) .tox/py3/lib/python3.7/site-packages/rest_framework/views.py:505: in dispatch response = self.handle_exception(exc) .tox/py3/lib/python3.7/site-packages/rest_framework/views.py:465: in handle_exception self.raise_uncaught_exception(exc) .tox/py3/lib/python3.7/site-packages/rest_framework/views.py:476: in raise_uncaught_exception raise exc .tox/py3/lib/python3.7/site-packages/rest_framework/views.py:502: in dispatch response = handler(request, *args, **kwargs) .tox/py3/lib/python3.7/site-packages/swh/deposit/api/private/__init__.py:91: in get return super().get(request, collection_name, deposit_id) .tox/py3/lib/python3.7/site-packages/swh/deposit/api/common.py:860: in get return FileResponse(content, status=status, content_type=content_type) .tox/py3/lib/python3.7/site-packages/django/http/response.py:399: in __init__ super().__init__(*args, **kwargs) .tox/py3/lib/python3.7/site-packages/django/http/response.py:360: in __init__ self.streaming_content = streaming_content .tox/py3/lib/python3.7/site-packages/django/http/response.py:375: in streaming_content self._set_streaming_content(value) .tox/py3/lib/python3.7/site-packages/django/http/response.py:410: in _set_streaming_content self.set_headers(filelike) .tox/py3/lib/python3.7/site-packages/django/http/response.py:426: in set_headers self['Content-Length'] = os.path.getsize(filelike.name) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ filename = '/tmp/swh-deposit/test/extraction-dir/swh.deposit-rju7o5y2/aggregate.zip' def getsize(filename): """Return the size of a file, reported by os.stat().""" > return os.stat(filename).st_size E FileNotFoundError: [Errno 2] No such file or directory: '/tmp/swh-deposit/test/extraction-dir/swh.deposit-rju7o5y2/aggregate.zip' /usr/lib/python3.7/genericpath.py:50: FileNotFoundError