Changeset View
Changeset View
Standalone View
Standalone View
swh/deposit/tests/api/test_deposit_private_check.py
Show First 20 Lines • Show All 231 Lines • ▼ Show 20 Lines | def create_deposit_archive_with_archive( | ||||
root_path, archive_extension, client, collection_name): | root_path, archive_extension, client, collection_name): | ||||
# we create the holding archive to a given extension | # we create the holding archive to a given extension | ||||
archive = create_arborescence_archive( | archive = create_arborescence_archive( | ||||
root_path, 'archive1', 'file1', b'some content in file', | root_path, 'archive1', 'file1', b'some content in file', | ||||
extension=archive_extension) | extension=archive_extension) | ||||
# now we create an archive holding the first created archive | # now we create an archive holding the first created archive | ||||
invalid_archive = create_archive_with_archive( | invalid_archive = create_archive_with_archive( | ||||
root_path, 'invalid.tar.gz', archive) | root_path, 'invalid.tgz', archive) | ||||
# we deposit it | # we deposit it | ||||
response = client.post( | response = client.post( | ||||
reverse(COL_IRI, args=[collection_name]), | reverse(COL_IRI, args=[collection_name]), | ||||
content_type='application/x-tar', | content_type='application/x-tar', | ||||
data=invalid_archive['data'], | data=invalid_archive['data'], | ||||
CONTENT_LENGTH=invalid_archive['length'], | CONTENT_LENGTH=invalid_archive['length'], | ||||
HTTP_MD5SUM=invalid_archive['md5sum'], | HTTP_MD5SUM=invalid_archive['md5sum'], | ||||
Show All 15 Lines |