@mock.patch('google.auth.transport.requests.AuthorizedSession')
def test_download_as_string(self, fake_session_factory):
    blob_name = 'blob-name'
    fake_session_factory.return_value = self._mock_download_transport()
    client = mock.Mock(_credentials=_make_credentials(), spec=['_credentials'])
    bucket = _Bucket(client)
    media_link = 'http://example.com/media/'
    properties = {'mediaLink': media_link}
    blob = self._make_one(blob_name, bucket=bucket, properties=properties)
    blob._CHUNK_SIZE_MULTIPLE = 1
    blob.chunk_size = 3
    fetched = blob.download_as_string()
    self.assertEqual(fetched, b'abcdef')
    self._check_session_mocks(client, fake_session_factory, media_link)
@mock.patch('google.auth.transport.requests.AuthorizedSession')
def test_download_as_string(self, fake_session_factory):
    blob_name = 'blob-name'
    fake_session_factory.return_value = self._mock_download_transport()
    client = mock.Mock(_credentials=_make_credentials(), spec=['_credentials'])
    bucket = _Bucket(client)
    media_link = 'http://example.com/media/'
    properties = {'mediaLink': media_link}
    blob = self._make_one(blob_name, bucket=bucket, properties=properties)
    blob._CHUNK_SIZE_MULTIPLE = 1
    blob.chunk_size = 3
    fetched = blob.download_as_string()
    self.assertEqual(fetched, b'abcdef')
    self._check_session_mocks(client, fake_session_factory, media_link)