@GlobalStorageAccountPreparer()
@AsyncStorageTestCase.await_prepared_test
async def test_create_blob_with_lease_id(self, resource_group, location, storage_account, storage_account_key):
    (await self._setup(storage_account.name, storage_account_key))
    blob_name = (await self._create_block_blob())
    blob = self.bsc.get_blob_client(self.container_name, blob_name)
    lease = (await blob.acquire_lease())
    data = b'hello world again'
    resp = (await blob.upload_blob(data, length=len(data), lease=lease))
    self.assertIsNotNone(resp.get('etag'))
    stream = (await blob.download_blob(lease=lease))
    content = (await stream.readall())
    self.assertEqual(content, data)
@GlobalStorageAccountPreparer()
@AsyncStorageTestCase.await_prepared_test
async def test_create_blob_with_lease_id(self, resource_group, location, storage_account, storage_account_key):
    (await self._setup(storage_account.name, storage_account_key))
    blob_name = (await self._create_block_blob())
    blob = self.bsc.get_blob_client(self.container_name, blob_name)
    lease = (await blob.acquire_lease())
    data = b'hello world again'
    resp = (await blob.upload_blob(data, length=len(data), lease=lease))
    self.assertIsNotNone(resp.get('etag'))
    stream = (await blob.download_blob(lease=lease))
    content = (await stream.readall())
    self.assertEqual(content, data)