Changeset View
Changeset View
Standalone View
Standalone View
swh/deposit/tests/api/test_deposit_read_archive.py
Show All 11 Lines | |||||
from rest_framework import status | from rest_framework import status | ||||
from rest_framework.test import APITestCase | from rest_framework.test import APITestCase | ||||
from swh.core import tarball | from swh.core import tarball | ||||
from swh.deposit.config import PRIVATE_GET_RAW_CONTENT | from swh.deposit.config import PRIVATE_GET_RAW_CONTENT | ||||
from swh.deposit.tests import TEST_CONFIG | from swh.deposit.tests import TEST_CONFIG | ||||
from ..common import BasicTestCase, WithAuthTestCase, CommonCreationRoutine | from ..common import BasicTestCase, WithAuthTestCase, CommonCreationRoutine | ||||
from ..common import FileSystemCreationRoutine, create_arborescence_zip | from ..common import FileSystemCreationRoutine, create_arborescence_archive | ||||
@attr('fs') | @attr('fs') | ||||
class DepositReadArchivesTest(APITestCase, WithAuthTestCase, | class DepositReadArchivesTest(APITestCase, WithAuthTestCase, | ||||
BasicTestCase, CommonCreationRoutine, | BasicTestCase, CommonCreationRoutine, | ||||
FileSystemCreationRoutine): | FileSystemCreationRoutine): | ||||
def setUp(self): | def setUp(self): | ||||
super().setUp() | super().setUp() | ||||
self.archive2 = create_arborescence_zip( | self.archive2 = create_arborescence_archive( | ||||
self.root_path, 'archive2', 'file2', b'some other content in file') | self.root_path, 'archive2', 'file2', b'some other content in file') | ||||
self.workdir = os.path.join(self.root_path, 'workdir') | self.workdir = os.path.join(self.root_path, 'workdir') | ||||
@istest | @istest | ||||
def access_to_existing_deposit_with_one_archive(self): | def access_to_existing_deposit_with_one_archive(self): | ||||
"""Access to deposit should stream a 200 response with its raw content | """Access to deposit should stream a 200 response with its raw content | ||||
""" | """ | ||||
▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines |