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

Side by Side Diff: tests/s3/test_connection.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/other_cacerts.txt ('k') | tests/s3/test_encryption.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 -*- 1 # -*- coding: utf-8 -*-
3 # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ 2 # Copyright (c) 2006-2011 Mitch Garnaat http://garnaat.org/
4 # 3 #
5 # Permission is hereby granted, free of charge, to any person obtaining a 4 # Permission is hereby granted, free of charge, to any person obtaining a
6 # copy of this software and associated documentation files (the 5 # copy of this software and associated documentation files (the
7 # "Software"), to deal in the Software without restriction, including 6 # "Software"), to deal in the Software without restriction, including
8 # without limitation the rights to use, copy, modify, merge, publish, dis- 7 # without limitation the rights to use, copy, modify, merge, publish, dis-
9 # tribute, sublicense, and/or sell copies of the Software, and to permit 8 # tribute, sublicense, and/or sell copies of the Software, and to permit
10 # persons to whom the Software is furnished to do so, subject to the fol- 9 # persons to whom the Software is furnished to do so, subject to the fol-
11 # lowing conditions: 10 # lowing conditions:
12 # 11 #
13 # The above copyright notice and this permission notice shall be included 12 # The above copyright notice and this permission notice shall be included
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 # check to make sure content read from s3 is identical to original 60 # check to make sure content read from s3 is identical to original
62 assert s1 == fp.read(), 'corrupted file' 61 assert s1 == fp.read(), 'corrupted file'
63 fp.close() 62 fp.close()
64 # test generated URLs 63 # test generated URLs
65 url = k.generate_url(3600) 64 url = k.generate_url(3600)
66 file = urllib.urlopen(url) 65 file = urllib.urlopen(url)
67 assert s1 == file.read(), 'invalid URL %s' % url 66 assert s1 == file.read(), 'invalid URL %s' % url
68 url = k.generate_url(3600, force_http=True) 67 url = k.generate_url(3600, force_http=True)
69 file = urllib.urlopen(url) 68 file = urllib.urlopen(url)
70 assert s1 == file.read(), 'invalid URL %s' % url 69 assert s1 == file.read(), 'invalid URL %s' % url
70 url = k.generate_url(3600, force_http=True, headers={'x-amz-x-token' : ' XYZ'})
71 file = urllib.urlopen(url)
72 assert s1 == file.read(), 'invalid URL %s' % url
71 bucket.delete_key(k) 73 bucket.delete_key(k)
72 # test a few variations on get_all_keys - first load some data 74 # test a few variations on get_all_keys - first load some data
73 # for the first one, let's override the content type 75 # for the first one, let's override the content type
74 phony_mimetype = 'application/x-boto-test' 76 phony_mimetype = 'application/x-boto-test'
75 headers = {'Content-Type': phony_mimetype} 77 headers = {'Content-Type': phony_mimetype}
76 k.name = 'foo/bar' 78 k.name = 'foo/bar'
77 k.set_contents_from_string(s1, headers) 79 k.set_contents_from_string(s1, headers)
78 k.name = 'foo/bas' 80 k.name = 'foo/bas'
79 k.set_contents_from_filename('foobar') 81 k.set_contents_from_filename('foobar')
80 k.name = 'foo/bat' 82 k.name = 'foo/bat'
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 180
179 # now delete all keys in bucket 181 # now delete all keys in bucket
180 for k in bucket: 182 for k in bucket:
181 if k.name == 'reduced_redundancy': 183 if k.name == 'reduced_redundancy':
182 assert k.storage_class == 'REDUCED_REDUNDANCY' 184 assert k.storage_class == 'REDUCED_REDUNDANCY'
183 bucket.delete_key(k) 185 bucket.delete_key(k)
184 # now delete bucket 186 # now delete bucket
185 time.sleep(5) 187 time.sleep(5)
186 c.delete_bucket(bucket) 188 c.delete_bucket(bucket)
187 print '--- tests completed ---' 189 print '--- tests completed ---'
OLDNEW
« no previous file with comments | « tests/s3/other_cacerts.txt ('k') | tests/s3/test_encryption.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698