summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Parslow <tom@almostobsolete.net>2012-09-06 20:32:44 +0100
committerThomas Parslow <tom@almostobsolete.net>2012-09-06 20:32:44 +0100
commitbac528e4d176b297448dc80ec5755c1100f57c24 (patch)
tree32babffaac4c13d0469f6166def330311a0a68ce
parent10736e4cf54ce0077aacedb9e40fb818dc1a89fe (diff)
downloadboto-bac528e4d176b297448dc80ec5755c1100f57c24.tar.gz
Not-yet-working integration test (commented out)
-rw-r--r--tests/integration/glacier/test_glacier_layer2.py60
1 files changed, 60 insertions, 0 deletions
diff --git a/tests/integration/glacier/test_glacier_layer2.py b/tests/integration/glacier/test_glacier_layer2.py
new file mode 100644
index 00000000..23951873
--- /dev/null
+++ b/tests/integration/glacier/test_glacier_layer2.py
@@ -0,0 +1,60 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2012 Thomas Parslow http://almostobsolete.net/
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish, dis-
+# tribute, sublicense, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the fol-
+# lowing conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
+# ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+#
+
+from boto.glacier import connect_to_region
+import uuid
+import unittest
+
+class GlaicerTest (unittest.TestCase):
+ glacier = True
+
+ def setUp(self):
+ self.conn = connect_to_region("us-east-1")
+ self.vault_name = 'boto-test-vault-%s' % (uuid.uuid1(),)
+ self.conn.create_vault(self.vault_name)
+ self.vault = self.conn.get_vault(self.vault_name)
+
+ def tearDown(self):
+ self.vault.delete()
+
+ ## Once you write to a vault you can't delete it for a few hours,
+ ## so this test doesn't work so well.
+ # def test_upload_vault(self):
+ # writer = self.vault.create_archive_writer(description="Hello world")
+ # # Would be nicer to write enough to splill over into a second
+ # # part, but that takes ages!
+ # for i in range(12):
+ # writer.write("X" * 1024)
+ # writer.close()
+ # archive_id = writer.get_archive_id()
+
+ # job_id = self.vault.retrieve_archive(archive_id, description="my job")
+
+ # # Usually at this point you;d wait for the notification via
+ # # SNS (which takes about 5 hours)
+
+ # job = self.vault.get_job(job_id)
+ # assert job.description == "my job"
+ # assert job.archive_size == 1024*12
+
+ # self.vault.delete_archive(archive_id)