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

Side by Side Diff: third_party/boto/tests/integration/s3/test_multipart.py

Issue 698893003: Update checked in version of gsutil to version 4.6 (Closed) Base URL: http://dart.googlecode.com/svn/third_party/gsutil/
Patch Set: Created 6 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
OLDNEW
1 # -*- coding: utf-8 -*- 1 # -*- coding: utf-8 -*-
2 2
3 # Copyright (c) 2011 Mitch Garnaat http://garnaat.org/ 3 # Copyright (c) 2011 Mitch Garnaat http://garnaat.org/
4 # All rights reserved. 4 # All rights reserved.
5 # 5 #
6 # Permission is hereby granted, free of charge, to any person obtaining a 6 # Permission is hereby granted, free of charge, to any person obtaining a
7 # copy of this software and associated documentation files (the 7 # copy of this software and associated documentation files (the
8 # "Software"), to deal in the Software without restriction, including 8 # "Software"), to deal in the Software without restriction, including
9 # without limitation the rights to use, copy, modify, merge, publish, dis- 9 # without limitation the rights to use, copy, modify, merge, publish, dis-
10 # tribute, sublicense, and/or sell copies of the Software, and to permit 10 # tribute, sublicense, and/or sell copies of the Software, and to permit
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 mpus.append(self.bucket.initiate_multipart_upload(key_name)) 93 mpus.append(self.bucket.initiate_multipart_upload(key_name))
94 mpus.append(self.bucket.initiate_multipart_upload(key_name)) 94 mpus.append(self.bucket.initiate_multipart_upload(key_name))
95 rs = self.bucket.list_multipart_uploads() 95 rs = self.bucket.list_multipart_uploads()
96 # uploads (for a key) are returned in time initiated asc order 96 # uploads (for a key) are returned in time initiated asc order
97 for lmpu in rs: 97 for lmpu in rs:
98 ompu = mpus.pop(0) 98 ompu = mpus.pop(0)
99 self.assertEqual(lmpu.key_name, ompu.key_name) 99 self.assertEqual(lmpu.key_name, ompu.key_name)
100 self.assertEqual(lmpu.id, ompu.id) 100 self.assertEqual(lmpu.id, ompu.id)
101 self.assertEqual(0, len(mpus)) 101 self.assertEqual(0, len(mpus))
102 102
103 def test_get_all_multipart_uploads(self):
104 key1 = 'a'
105 key2 = 'b/c'
106 mpu1 = self.bucket.initiate_multipart_upload(key1)
107 mpu2 = self.bucket.initiate_multipart_upload(key2)
108 rs = self.bucket.get_all_multipart_uploads(prefix='b/', delimiter='/')
109 for lmpu in rs:
110 # only expect upload for key2 (mpu2) returned
111 self.assertEqual(lmpu.key_name, mpu2.key_name)
112 self.assertEqual(lmpu.id, mpu2.id)
113
103 def test_four_part_file(self): 114 def test_four_part_file(self):
104 key_name = "k" 115 key_name = "k"
105 contents = "01234567890123456789" 116 contents = "01234567890123456789"
106 sfp = StringIO.StringIO(contents) 117 sfp = StringIO.StringIO(contents)
107 118
108 # upload 20 bytes in 4 parts of 5 bytes each 119 # upload 20 bytes in 4 parts of 5 bytes each
109 mpu = self.bucket.initiate_multipart_upload(key_name) 120 mpu = self.bucket.initiate_multipart_upload(key_name)
110 mpu.upload_part_from_file(sfp, part_num=1, size=5) 121 mpu.upload_part_from_file(sfp, part_num=1, size=5)
111 mpu.upload_part_from_file(sfp, part_num=2, size=5) 122 mpu.upload_part_from_file(sfp, part_num=2, size=5)
112 mpu.upload_part_from_file(sfp, part_num=3, size=5) 123 mpu.upload_part_from_file(sfp, part_num=3, size=5)
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 uparts.append(mpu.upload_part_from_file(fp, part_num=1, size=5)) 155 uparts.append(mpu.upload_part_from_file(fp, part_num=1, size=5))
145 uparts.append(mpu.upload_part_from_file(fp, part_num=2)) 156 uparts.append(mpu.upload_part_from_file(fp, part_num=2))
146 fp.close() 157 fp.close()
147 # compare uploaded parts etag to listed parts 158 # compare uploaded parts etag to listed parts
148 pn = 0 159 pn = 0
149 for lpart in mpu: 160 for lpart in mpu:
150 self.assertEqual(uparts[pn].etag, lpart.etag) 161 self.assertEqual(uparts[pn].etag, lpart.etag)
151 pn += 1 162 pn += 1
152 # Can't complete 2 small parts so just clean up. 163 # Can't complete 2 small parts so just clean up.
153 mpu.cancel_upload() 164 mpu.cancel_upload()
OLDNEW
« no previous file with comments | « third_party/boto/tests/integration/s3/test_key.py ('k') | third_party/boto/tests/integration/sts/test_session_token.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698