@@ -729,7 +729,7 @@ def test_upload_from_string_w_text(self):
729729 self .assertEqual (headers ['Content-Type' ], 'text/plain' )
730730 self .assertEqual (rq [0 ]['body' ], ENCODED )
731731
732- def test_make_public (self ):
732+ def test_make_public_w_implicit_ocnnection (self ):
733733 from gcloud .storage .acl import _ACLEntity
734734 from gcloud .storage ._testing import _monkey_defaults
735735 BLOB_NAME = 'blob-name'
@@ -749,6 +749,24 @@ def test_make_public(self):
749749 self .assertEqual (kw [0 ]['data' ], {'acl' : permissive })
750750 self .assertEqual (kw [0 ]['query_params' ], {'projection' : 'full' })
751751
752+ def test_make_public_w_explicit_connection (self ):
753+ from gcloud .storage .acl import _ACLEntity
754+ BLOB_NAME = 'blob-name'
755+ permissive = [{'entity' : 'allUsers' , 'role' : _ACLEntity .READER_ROLE }]
756+ after = {'acl' : permissive }
757+ connection = _Connection (after )
758+ bucket = _Bucket (None )
759+ blob = self ._makeOne (BLOB_NAME , bucket = bucket )
760+ blob .acl .loaded = True
761+ blob .make_public (connection = connection )
762+ self .assertEqual (list (blob .acl ), permissive )
763+ kw = connection ._requested
764+ self .assertEqual (len (kw ), 1 )
765+ self .assertEqual (kw [0 ]['method' ], 'PATCH' )
766+ self .assertEqual (kw [0 ]['path' ], '/b/name/o/%s' % BLOB_NAME )
767+ self .assertEqual (kw [0 ]['data' ], {'acl' : permissive })
768+ self .assertEqual (kw [0 ]['query_params' ], {'projection' : 'full' })
769+
752770 def test_cache_control_getter (self ):
753771 BLOB_NAME = 'blob-name'
754772 connection = _Connection ()
0 commit comments