Glacier - allow zipfiles to be uploaded (#4800)

This commit is contained in:
Bert Blommers 2022-01-27 09:40:42 -01:00 committed by GitHub
parent 010d525de0
commit 4bd8f4f96f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 1 deletions

View File

@ -55,7 +55,6 @@ class GlacierResponse(BaseResponse):
return 204, headers, ""
def vault_archive_response(self, request, full_url, headers):
self.setup_class(request, full_url, headers)
return self._vault_archive_response(request, full_url, headers)
def _vault_archive_response(self, request, full_url, headers):

BIN
tests/test_glacier/test.gz Normal file

Binary file not shown.

View File

@ -1,4 +1,5 @@
import boto3
import os
import sure # noqa # pylint: disable=unused-import
import pytest
@ -23,6 +24,21 @@ def test_upload_archive():
res.should.have.key("archiveId")
@mock_glacier
def test_upload_zip_archive():
client = boto3.client("glacier", region_name="us-west-2")
client.create_vault(vaultName="asdf")
path = "test.gz"
with open(os.path.join(os.path.dirname(__file__), path), mode="rb") as archive:
content = archive.read()
res = client.upload_archive(vaultName="asdf", body=content)
res["ResponseMetadata"]["HTTPStatusCode"].should.equal(201)
res.should.have.key("checksum")
@mock_glacier
def test_delete_archive():
client = boto3.client("glacier", region_name="us-west-2")