diff --git a/swh/deposit/tests/api/test_deposit_private_read_archive.py b/swh/deposit/tests/api/test_deposit_private_read_archive.py --- a/swh/deposit/tests/api/test_deposit_private_read_archive.py +++ b/swh/deposit/tests/api/test_deposit_private_read_archive.py @@ -1,14 +1,16 @@ -# Copyright (C) 2017-2019 The Software Heritage developers +# Copyright (C) 2017-2021 The Software Heritage developers # See the AUTHORS file at the top-level directory of this distribution # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information import io +from os.path import exists, join import zipfile from django.urls import reverse from rest_framework import status +from swh.deposit.api.private.deposit_read import aggregate_tarballs from swh.deposit.config import EM_IRI, PRIVATE_GET_RAW_CONTENT from swh.deposit.tests.common import create_arborescence_archive @@ -84,3 +86,10 @@ assert set(zfile.namelist()) == {"file1", "file2"} assert zfile.open("file1").read() == b"some content in file" assert zfile.open("file2").read() == b"some other content in file" + + +def test_aggregate_tarballs_with_strange_archive(datadir, tmp_path): + archive = join(datadir, "archives", "single-artifact-package.tar.gz") + + with aggregate_tarballs(tmp_path, [archive]) as tarball_path: + assert exists(tarball_path)