mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 16:57:53 +00:00
Improve backup tests (#142785)
This commit is contained in:
parent
514363f1c5
commit
5f2ae37ee5
@ -17,6 +17,7 @@ async def test_async_get_manager(hass: HomeAssistant) -> None:
|
||||
backup_helper.async_initialize_backup(hass)
|
||||
task = asyncio.create_task(backup_helper.async_get_manager(hass))
|
||||
assert await async_setup_component(hass, BACKUP_DOMAIN, {})
|
||||
await hass.async_block_till_done()
|
||||
manager = await task
|
||||
assert manager is hass.data[backup_helper.DATA_MANAGER]
|
||||
|
||||
@ -36,7 +37,5 @@ async def test_async_get_manager_backup_failed_setup(hass: HomeAssistant) -> Non
|
||||
side_effect=Exception("Boom!"),
|
||||
):
|
||||
assert not await async_setup_component(hass, BACKUP_DOMAIN, {})
|
||||
with (
|
||||
pytest.raises(Exception, match="Boom!"),
|
||||
):
|
||||
with pytest.raises(Exception, match="Boom!"):
|
||||
await backup_helper.async_get_manager(hass)
|
||||
|
Loading…
x
Reference in New Issue
Block a user