Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(220)

Side by Side Diff: tests/s3/test_versioning.py

Issue 8386013: Merging in latest boto. (Closed) Base URL: svn://svn.chromium.org/boto
Patch Set: Redoing vendor drop by deleting and then merging. Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/s3/test_resumable_uploads.py ('k') | tests/sdb/__init__.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 # Copyright (c) 2010 Mitch Garnaat http://garnaat.org/ 1 # Copyright (c) 2010 Mitch Garnaat http://garnaat.org/
4 # Copyright (c) 2010, Eucalyptus Systems, Inc. 2 # Copyright (c) 2010, Eucalyptus Systems, Inc.
5 # All rights reserved. 3 # All rights reserved.
6 # 4 #
7 # Permission is hereby granted, free of charge, to any person obtaining a 5 # Permission is hereby granted, free of charge, to any person obtaining a
8 # copy of this software and associated documentation files (the 6 # copy of this software and associated documentation files (the
9 # "Software"), to deal in the Software without restriction, including 7 # "Software"), to deal in the Software without restriction, including
10 # without limitation the rights to use, copy, modify, merge, publish, dis- 8 # without limitation the rights to use, copy, modify, merge, publish, dis-
11 # tribute, sublicense, and/or sell copies of the Software, and to permit 9 # tribute, sublicense, and/or sell copies of the Software, and to permit
12 # persons to whom the Software is furnished to do so, subject to the fol- 10 # persons to whom the Software is furnished to do so, subject to the fol-
(...skipping 29 matching lines...) Expand all
42 bucket_name = 'version-%d' % int(time.time()) 40 bucket_name = 'version-%d' % int(time.time())
43 bucket = c.create_bucket(bucket_name) 41 bucket = c.create_bucket(bucket_name)
44 42
45 # now try a get_bucket call and see if it's really there 43 # now try a get_bucket call and see if it's really there
46 bucket = c.get_bucket(bucket_name) 44 bucket = c.get_bucket(bucket_name)
47 45
48 # enable versions 46 # enable versions
49 d = bucket.get_versioning_status() 47 d = bucket.get_versioning_status()
50 assert not d.has_key('Versioning') 48 assert not d.has_key('Versioning')
51 bucket.configure_versioning(versioning=True) 49 bucket.configure_versioning(versioning=True)
52 time.sleep(5) 50 time.sleep(15)
53 d = bucket.get_versioning_status() 51 d = bucket.get_versioning_status()
54 assert d['Versioning'] == 'Enabled' 52 assert d['Versioning'] == 'Enabled'
55 53
56 # create a new key in the versioned bucket 54 # create a new key in the versioned bucket
57 k = bucket.new_key() 55 k = bucket.new_key()
58 k.name = 'foobar' 56 k.name = 'foobar'
59 s1 = 'This is a test of s3 versioning' 57 s1 = 'This is a test of s3 versioning'
60 s2 = 'This is the second test of s3 versioning' 58 s2 = 'This is the second test of s3 versioning'
61 k.set_contents_from_string(s1) 59 k.set_contents_from_string(s1)
62 time.sleep(5) 60 time.sleep(5)
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 # Now suspend Versioning on the bucket 136 # Now suspend Versioning on the bucket
139 bucket.configure_versioning(False) 137 bucket.configure_versioning(False)
140 138
141 # now delete all keys and deletemarkers in bucket 139 # now delete all keys and deletemarkers in bucket
142 for k in bucket.list_versions(): 140 for k in bucket.list_versions():
143 bucket.delete_key(k.name, version_id=k.version_id) 141 bucket.delete_key(k.name, version_id=k.version_id)
144 142
145 # now delete bucket 143 # now delete bucket
146 c.delete_bucket(bucket) 144 c.delete_bucket(bucket)
147 print '--- tests completed ---' 145 print '--- tests completed ---'
OLDNEW
« no previous file with comments | « tests/s3/test_resumable_uploads.py ('k') | tests/sdb/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698