@GlobalStorageAccountPreparer()
@AsyncStorageTestCase.await_prepared_test
async def test_lease_blob_break_period(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(lease_duration=15))
    lease_time = (await lease.break_lease(lease_break_period=5))
    resp = (await blob.upload_blob(b'hello 2', length=7, lease=lease))
    self.sleep(5)
    with self.assertRaises(HttpResponseError):
        (await blob.upload_blob(b'hello 3', length=7, lease=lease))
    self.assertIsNotNone(lease.id)
    self.assertIsNotNone(lease_time)
    self.assertIsNotNone(resp.get('etag'))
@GlobalStorageAccountPreparer()
@AsyncStorageTestCase.await_prepared_test
async def test_lease_blob_break_period(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(lease_duration=15))
    lease_time = (await lease.break_lease(lease_break_period=5))
    resp = (await blob.upload_blob(b'hello 2', length=7, lease=lease))
    self.sleep(5)
    with self.assertRaises(HttpResponseError):
        (await blob.upload_blob(b'hello 3', length=7, lease=lease))
    self.assertIsNotNone(lease.id)
    self.assertIsNotNone(lease_time)
    self.assertIsNotNone(resp.get('etag'))