@@ -116,7 +116,7 @@ def tearDown(self):
116116class TestStorageWriteFiles (TestStorageFiles ):
117117
118118 def test_large_file_write_from_stream (self ):
119- blob = self . bucket . new_blob ( 'LargeFile' )
119+ blob = storage . Blob ( bucket = self . bucket , name = 'LargeFile' )
120120 self .assertEqual (blob ._properties , {})
121121
122122 file_data = self .FILES ['big' ]
@@ -128,7 +128,7 @@ def test_large_file_write_from_stream(self):
128128 self .assertEqual (blob .md5_hash , file_data ['hash' ])
129129
130130 def test_small_file_write_from_filename (self ):
131- blob = self . bucket . new_blob ( 'LargeFile' )
131+ blob = storage . Blob ( bucket = self . bucket , name = 'LargeFile' )
132132 self .assertEqual (blob ._properties , {})
133133
134134 file_data = self .FILES ['simple' ]
@@ -149,12 +149,12 @@ def test_write_metadata(self):
149149 self .assertEqual (blob .content_type , 'image/png' )
150150
151151 def test_direct_write_and_read_into_file (self ):
152- blob = self . bucket . new_blob ( 'MyBuffer' )
152+ blob = storage . Blob ( bucket = self . bucket , name = 'MyBuffer' )
153153 file_contents = 'Hello World'
154154 blob .upload_from_string (file_contents )
155155 self .case_blobs_to_delete .append (blob )
156156
157- same_blob = self . bucket . new_blob ( 'MyBuffer' )
157+ same_blob = storage . Blob ( bucket = self . bucket , name = 'MyBuffer' )
158158 temp_filename = tempfile .mktemp ()
159159 with open (temp_filename , 'w' ) as file_obj :
160160 same_blob .download_to_file (file_obj )
@@ -306,7 +306,7 @@ def setUp(self):
306306 with open (logo_path , 'r' ) as file_obj :
307307 self .LOCAL_FILE = file_obj .read ()
308308
309- blob = self . bucket . new_blob ( 'LogoToSign.jpg' )
309+ blob = storage . Blob ( bucket = self . bucket , name = 'LogoToSign.jpg' )
310310 blob .upload_from_string (self .LOCAL_FILE )
311311 self .case_blobs_to_delete .append (blob )
312312
@@ -316,7 +316,7 @@ def tearDown(self):
316316 blob .delete ()
317317
318318 def test_create_signed_read_url (self ):
319- blob = self . bucket . new_blob ( 'LogoToSign.jpg' )
319+ blob = storage . Blob ( bucket = self . bucket , name = 'LogoToSign.jpg' )
320320 expiration = int (time .time () + 5 )
321321 signed_url = blob .generate_signed_url (expiration , method = 'GET' )
322322
@@ -325,7 +325,7 @@ def test_create_signed_read_url(self):
325325 self .assertEqual (content , self .LOCAL_FILE )
326326
327327 def test_create_signed_delete_url (self ):
328- blob = self . bucket . new_blob ( 'LogoToSign.jpg' )
328+ blob = storage . Blob ( bucket = self . bucket , name = 'LogoToSign.jpg' )
329329 expiration = int (time .time () + 283473274 )
330330 signed_delete_url = blob .generate_signed_url (expiration ,
331331 method = 'DELETE' )
0 commit comments