File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 2828
2929from system_test_utils import unique_resource_id
3030from retry import RetryErrors
31+ from retry import RetryResult
3132
3233
3334retry_429 = RetryErrors (exceptions .TooManyRequests )
@@ -225,8 +226,16 @@ def tearDownClass(cls):
225226 blob .delete ()
226227
227228 def test_list_files (self ):
228- all_blobs = list (self .bucket .list_blobs ())
229- self .assertEqual (len (all_blobs ), len (self .FILENAMES ))
229+ def _all_in_list (blobs ):
230+ return len (blobs ) == len (self .FILENAMES )
231+
232+ def _all_blobs ():
233+ return list (self .bucket .list_blobs ())
234+
235+ retry = RetryResult (_all_in_list )
236+ all_blobs = retry (_all_blobs )()
237+ self .assertEqual (sorted (blob .name for blob in all_blobs ),
238+ sorted (self .FILENAMES ))
230239
231240 def test_paginate_files (self ):
232241 truncation_size = 1
You can’t perform that action at this time.
0 commit comments