moto/tests/test_glacier/test_glacier_archives.py

22 lines
521 B
Python
Raw Normal View History

2015-06-05 23:36:43 +00:00
from __future__ import unicode_literals
from tempfile import NamedTemporaryFile
import boto.glacier
import sure # noqa
2017-02-16 03:35:45 +00:00
from moto import mock_glacier_deprecated
2015-06-05 23:36:43 +00:00
2017-02-16 03:35:45 +00:00
@mock_glacier_deprecated
2015-06-05 23:36:43 +00:00
def test_create_and_delete_archive():
the_file = NamedTemporaryFile(delete=False)
2015-06-05 23:56:43 +00:00
the_file.write(b"some stuff")
2015-06-05 23:36:43 +00:00
the_file.close()
conn = boto.glacier.connect_to_region("us-west-2")
vault = conn.create_vault("my_vault")
archive_id = vault.upload_archive(the_file.name)
vault.delete_archive(archive_id)