mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 00:37:53 +00:00
Add squeezebox API failure test (#128066)
* add api failure test * Update tests/components/squeezebox/test_init.py --------- Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
This commit is contained in:
parent
2ab5e5d267
commit
0fcbfa996f
23
tests/components/squeezebox/test_init.py
Normal file
23
tests/components/squeezebox/test_init.py
Normal file
@ -0,0 +1,23 @@
|
||||
"""Test squeezebox initialization."""
|
||||
|
||||
from unittest.mock import patch
|
||||
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
||||
from tests.common import MockConfigEntry
|
||||
|
||||
|
||||
async def test_init_api_fail(
|
||||
hass: HomeAssistant,
|
||||
config_entry: MockConfigEntry,
|
||||
) -> None:
|
||||
"""Test init fail due to API fail."""
|
||||
|
||||
# Setup component to fail...
|
||||
with (
|
||||
patch(
|
||||
"homeassistant.components.squeezebox.Server.async_query",
|
||||
return_value=False,
|
||||
),
|
||||
):
|
||||
assert not await hass.config_entries.async_setup(config_entry.entry_id)
|
Loading…
x
Reference in New Issue
Block a user