@@ -257,19 +257,32 @@ def test_exists_miss(self):
257257 NONESUCH = 'nonesuch'
258258 not_found_response = {'status' : NOT_FOUND }
259259 connection = _Connection (not_found_response )
260+ client = _Client (connection )
260261 bucket = _Bucket ()
261262 blob = self ._makeOne (NONESUCH , bucket = bucket )
262- self .assertFalse (blob .exists (connection = connection ))
263+ self .assertFalse (blob .exists (client = client ))
264+
265+ def test_exists_implicit (self ):
266+ from gcloud .storage ._testing import _monkey_defaults
267+ from six .moves .http_client import NOT_FOUND
268+ NONESUCH = 'nonesuch'
269+ not_found_response = {'status' : NOT_FOUND }
270+ connection = _Connection (not_found_response )
271+ bucket = _Bucket ()
272+ blob = self ._makeOne (NONESUCH , bucket = bucket )
273+ with _monkey_defaults (connection = connection ):
274+ self .assertFalse (blob .exists ())
263275
264276 def test_exists_hit (self ):
265277 from six .moves .http_client import OK
266278 BLOB_NAME = 'blob-name'
267279 found_response = {'status' : OK }
268280 connection = _Connection (found_response )
281+ client = _Client (connection )
269282 bucket = _Bucket ()
270283 blob = self ._makeOne (BLOB_NAME , bucket = bucket )
271284 bucket ._blobs [BLOB_NAME ] = 1
272- self .assertTrue (blob .exists (connection = connection ))
285+ self .assertTrue (blob .exists (client = client ))
273286
274287 def test_rename_w_implicit_connection (self ):
275288 from gcloud .storage ._testing import _monkey_defaults
@@ -307,24 +320,26 @@ def test_delete_w_implicit_connection(self):
307320 BLOB_NAME = 'blob-name'
308321 not_found_response = {'status' : NOT_FOUND }
309322 connection = _Connection (not_found_response )
323+ client = _Client (connection )
310324 bucket = _Bucket ()
311325 blob = self ._makeOne (BLOB_NAME , bucket = bucket )
312326 bucket ._blobs [BLOB_NAME ] = 1
313327 with _monkey_defaults (connection = connection ):
314328 blob .delete ()
315- self .assertFalse (blob .exists (connection = connection ))
329+ self .assertFalse (blob .exists (client = client ))
316330 self .assertEqual (bucket ._deleted , [(BLOB_NAME , connection )])
317331
318332 def test_delete_w_explicit_connection (self ):
319333 from six .moves .http_client import NOT_FOUND
320334 BLOB_NAME = 'blob-name'
321335 not_found_response = {'status' : NOT_FOUND }
322336 connection = _Connection (not_found_response )
337+ client = _Client (connection )
323338 bucket = _Bucket ()
324339 blob = self ._makeOne (BLOB_NAME , bucket = bucket )
325340 bucket ._blobs [BLOB_NAME ] = 1
326341 blob .delete (connection = connection )
327- self .assertFalse (blob .exists (connection = connection ))
342+ self .assertFalse (blob .exists (client = client ))
328343 self .assertEqual (bucket ._deleted , [(BLOB_NAME , connection )])
329344
330345 def _download_to_file_helper (self , chunk_size = None ):
0 commit comments