def _list_files(bucket):
     self.assertEqual('sample-app', bucket)
     # Include two files, one recent, one old.
     recent = cloudstorage.GCSFileStat(filename=bucket +
                                       '/namespace/recent',
                                       st_size=10,
                                       etag='123',
                                       st_ctime=now - 24 * 60 * 60,
                                       content_type=None,
                                       metadata=None,
                                       is_dir=False)
     old = cloudstorage.GCSFileStat(filename=bucket + '/namespace/old',
                                    st_size=11,
                                    etag='123',
                                    st_ctime=now - 24 * 60 * 60 - 1,
                                    content_type=None,
                                    metadata=None,
                                    is_dir=False)
     return [('namespace/recent', recent), ('namespace/old', old)]
Exemplo n.º 2
0
 def _fake_listbucket(bucket_prefix):
     filenames = [
         'input.csv',
         'subdir/input.csv',
         'data.csv',
         'subdir/data.csv',
     ]
     for suffix in filenames:
         filename = os.path.join(bucket_prefix, suffix)
         stat = cloudstorage.GCSFileStat(filename, 0,
                                         '686897696a7c876b7e', 0)
         yield stat
Exemplo n.º 3
0
 def stat_mock(filename, retry_params):
   if filename in existing_files:
     return cloudstorage.GCSFileStat(filename, 0, 'etag', 0)
   raise cloudstorage.NotFoundError()