11"""
2- Copyright 2023 Google LLC
2+ Copyright 2024 Google LLC
33
44 Licensed under the Apache License, Version 2.0 (the "License");
55 you may not use this file except in compliance with the License.
@@ -35,29 +35,6 @@ def test_compose(self):
3535 self .assertEqual (blob .name , destination_blob_name )
3636 self .assertEqual (blob .content , expected_result )
3737
38- def test_compose_retries (self ):
39- bucket_name = "test_bucket"
40- destination_blob_name = "dest_name"
41- objects = [("one" , 3 ), ("two" , 3 ), ("three" , 5 )]
42- client = fake_gcs .Client ()
43- bucket = client .bucket (bucket_name )
44- bucket ._add_file ("one" , bytes ("one" , "utf-8" ))
45- bucket ._add_file ("two" , bytes ("two" , "utf-8" ))
46- bucket ._add_file ("three" , bytes ("three" , "utf-8" ))
47- client .error_count = 2
48- expected_result = b"onetwothree"
49- blob = download .compose ("" , bucket_name , destination_blob_name , objects , client )
50- self .assertEqual (blob .name , destination_blob_name )
51- self .assertEqual (blob .content , expected_result )
52- client .error_count = 3
53- try :
54- blob = download .compose (
55- "" , bucket_name , destination_blob_name , objects , client
56- )
57- self .fail (f"expected RuntimeError but got { blob } " )
58- except RuntimeError :
59- pass
60-
6138 def test_decompose (self ):
6239 bucket_name = "test_bucket"
6340 object_name = "test_obj"
@@ -78,23 +55,6 @@ def test_download_single(self):
7855 result = download .download_single (client , bucket_name , object_name )
7956 self .assertEqual (result , content )
8057
81- def test_download_retry (self ):
82- client = fake_gcs .Client ()
83- bucket_name = "test_bucket"
84- object_name = "test_obj"
85- content = bytes ("onetwothree" , "utf-8" )
86- bucket = client .bucket (bucket_name )
87- bucket ._add_file (object_name , content )
88- client .error_count = 2
89- result = download .download_single (client , bucket_name , object_name )
90- self .assertEqual (result , content )
91- client .error_count = 3
92- try :
93- result = download .download_single (client , bucket_name , object_name )
94- self .fail (f"expected RuntimeError but got { result } " )
95- except RuntimeError :
96- pass
97-
9858 def test_dataflux_download (self ):
9959 bucket_name = "test_bucket"
10060 objects = [("one" , 3 ), ("two" , 3 ), ("three" , 5 )]
0 commit comments