@pytest.mark.live_test_only
@GlobalStorageAccountPreparer()
@AsyncStorageTestCase.await_prepared_test
async def test_public_access_blob(self, resource_group, location, storage_account, storage_account_key):
    (await self._setup(storage_account.name, storage_account_key))
    data = b'public access blob'
    blob_name = 'blob1.txt'
    container_name = self._get_container_reference()
    try:
        container = (await self.bsc.create_container(container_name, public_access='blob'))
    except ResourceExistsError:
        container = self.bsc.get_container_client(container_name)
    blob = (await container.upload_blob(blob_name, data))
    service = BlobClient.from_blob_url(blob.url)
    content = (await (await service.download_blob()).readall())
    self.assertEqual(data, content)
@pytest.mark.live_test_only
@GlobalStorageAccountPreparer()
@AsyncStorageTestCase.await_prepared_test
async def test_public_access_blob(self, resource_group, location, storage_account, storage_account_key):
    (await self._setup(storage_account.name, storage_account_key))
    data = b'public access blob'
    blob_name = 'blob1.txt'
    container_name = self._get_container_reference()
    try:
        container = (await self.bsc.create_container(container_name, public_access='blob'))
    except ResourceExistsError:
        container = self.bsc.get_container_client(container_name)
    blob = (await container.upload_blob(blob_name, data))
    service = BlobClient.from_blob_url(blob.url)
    content = (await (await service.download_blob()).readall())
    self.assertEqual(data, content)