diff --git a/moto/glacier/responses.py b/moto/glacier/responses.py index 2703638c5..6937d1645 100644 --- a/moto/glacier/responses.py +++ b/moto/glacier/responses.py @@ -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): diff --git a/tests/test_glacier/test.gz b/tests/test_glacier/test.gz new file mode 100644 index 000000000..ff5fdc919 Binary files /dev/null and b/tests/test_glacier/test.gz differ diff --git a/tests/test_glacier/test_glacier_archives.py b/tests/test_glacier/test_glacier_archives.py index 935c83d70..bbfffcd06 100644 --- a/tests/test_glacier/test_glacier_archives.py +++ b/tests/test_glacier/test_glacier_archives.py @@ -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")