def test_make_public(self):
    from google.cloud.storage.acl import _ACLEntity
    BLOB_NAME = 'blob-name'
    permissive = [{'entity': 'allUsers', 'role': _ACLEntity.READER_ROLE}]
    after = ({'status': http_client.OK}, {'acl': permissive})
    connection = _Connection(after)
    client = _Client(connection)
    bucket = _Bucket(client=client)
    blob = self._make_one(BLOB_NAME, bucket=bucket)
    blob.acl.loaded = True
    blob.make_public()
    self.assertEqual(list(blob.acl), permissive)
    kw = connection._requested
    self.assertEqual(len(kw), 1)
    self.assertEqual(kw[0]['method'], 'PATCH')
    self.assertEqual(kw[0]['path'], ('/b/name/o/%s' % BLOB_NAME))
    self.assertEqual(kw[0]['data'], {'acl': permissive})
    self.assertEqual(kw[0]['query_params'], {'projection': 'full'})
def test_make_public(self):
    from google.cloud.storage.acl import _ACLEntity
    BLOB_NAME = 'blob-name'
    permissive = [{'entity': 'allUsers', 'role': _ACLEntity.READER_ROLE}]
    after = ({'status': http_client.OK}, {'acl': permissive})
    connection = _Connection(after)
    client = _Client(connection)
    bucket = _Bucket(client=client)
    blob = self._make_one(BLOB_NAME, bucket=bucket)
    blob.acl.loaded = True
    blob.make_public()
    self.assertEqual(list(blob.acl), permissive)
    kw = connection._requested
    self.assertEqual(len(kw), 1)
    self.assertEqual(kw[0]['method'], 'PATCH')
    self.assertEqual(kw[0]['path'], ('/b/name/o/%s' % BLOB_NAME))
    self.assertEqual(kw[0]['data'], {'acl': permissive})
    self.assertEqual(kw[0]['query_params'], {'projection': 'full'})