@@ -219,7 +219,11 @@ def test_website_redirect_ignore_paramfile(self):
219219
220220 def test_metadata_copy (self ):
221221 self .parsed_responses = [
222- {"ContentLength" : "100" , "LastModified" : "00:00:00Z" },
222+ {
223+ "ContentLength" : "100" ,
224+ "LastModified" : "00:00:00Z" ,
225+ 'ETag' : '"foo-1"' ,
226+ },
223227 {'ETag' : '"foo-1"' },
224228 ]
225229 cmdline = ('%s s3://bucket/key.txt s3://bucket/key2.txt'
@@ -267,7 +271,11 @@ def test_metadata_copy_with_multipart_upload(self):
267271
268272 def test_metadata_directive_copy (self ):
269273 self .parsed_responses = [
270- {"ContentLength" : "100" , "LastModified" : "00:00:00Z" },
274+ {
275+ "ContentLength" : "100" ,
276+ "LastModified" : "00:00:00Z" ,
277+ "ETag" : "'foo-1'" ,
278+ },
271279 {'ETag' : '"foo-1"' },
272280 ]
273281 cmdline = ('%s s3://bucket/key.txt s3://bucket/key2.txt'
@@ -610,7 +618,11 @@ def test_cp_upload_large_file_with_sse_kms_and_key_id(self):
610618
611619 def test_cp_copy_with_sse_kms_and_key_id (self ):
612620 self .parsed_responses = [
613- {'ContentLength' : 5 , 'LastModified' : '00:00:00Z' }, # HeadObject
621+ {
622+ 'ContentLength' : 5 ,
623+ 'LastModified' : '00:00:00Z' ,
624+ 'ETag' : '"foo"' ,
625+ }, # HeadObject
614626 {} # CopyObject
615627 ]
616628 cmdline = (
@@ -636,8 +648,11 @@ def test_cp_copy_with_sse_kms_and_key_id(self):
636648
637649 def test_cp_copy_large_file_with_sse_kms_and_key_id (self ):
638650 self .parsed_responses = [
639- {'ContentLength' : 10 * (1024 ** 2 ),
640- 'LastModified' : '00:00:00Z' }, # HeadObject
651+ {
652+ 'ContentLength' : 10 * (1024 ** 2 ),
653+ 'LastModified' : '00:00:00Z' ,
654+ 'ETag' : '"foo"' ,
655+ }, # HeadObject
641656 {'UploadId' : 'foo' }, # CreateMultipartUpload
642657 {'CopyPartResult' : {'ETag' : '"foo"' }}, # UploadPartCopy
643658 {'CopyPartResult' : {'ETag' : '"foo"' }}, # UploadPartCopy
@@ -669,8 +684,11 @@ def test_cannot_use_recursive_with_stream(self):
669684
670685 def test_upload_unicode_path (self ):
671686 self .parsed_responses = [
672- {'ContentLength' : 10 ,
673- 'LastModified' : '00:00:00Z' }, # HeadObject
687+ {
688+ 'ContentLength' : 10 ,
689+ 'LastModified' : '00:00:00Z' ,
690+ 'ETag' : '"foo"' ,
691+ }, # HeadObject
674692 {'ETag' : '"foo"' } # PutObject
675693 ]
676694 command = u's3 cp s3://bucket/\u2603 s3://bucket/\u2713 '
@@ -1128,11 +1146,11 @@ def test_multipart_copy(self):
11281146 self .upload_part_copy_request (
11291147 'sourcebucket' , 'sourcekey' , 'mybucket' , 'mykey' ,
11301148 upload_id , PartNumber = mock .ANY , RequestPayer = 'requester' ,
1131- CopySourceRange = mock .ANY ),
1149+ CopySourceRange = mock .ANY , CopySourceIfMatch = '"foo-1"' ),
11321150 self .upload_part_copy_request (
11331151 'sourcebucket' , 'sourcekey' , 'mybucket' , 'mykey' ,
11341152 upload_id , PartNumber = mock .ANY , RequestPayer = 'requester' ,
1135- CopySourceRange = mock .ANY ),
1153+ CopySourceRange = mock .ANY , CopySourceIfMatch = '"foo-1"' ),
11361154 self .complete_mpu_request (
11371155 'mybucket' , 'mykey' , upload_id , num_parts = 2 ,
11381156 RequestPayer = 'requester' )
0 commit comments