Fix otbr tests (#88184)
This commit is contained in:
parent
2af4d2152b
commit
6254200b37
2 changed files with 8 additions and 1 deletions
|
@ -22,3 +22,8 @@ async def otbr_config_entry_fixture(hass):
|
||||||
config_entry.add_to_hass(hass)
|
config_entry.add_to_hass(hass)
|
||||||
with patch("python_otbr_api.OTBR.get_active_dataset_tlvs", return_value=DATASET):
|
with patch("python_otbr_api.OTBR.get_active_dataset_tlvs", return_value=DATASET):
|
||||||
assert await hass.config_entries.async_setup(config_entry.entry_id)
|
assert await hass.config_entries.async_setup(config_entry.entry_id)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(autouse=True)
|
||||||
|
def use_mocked_zeroconf(mock_async_zeroconf):
|
||||||
|
"""Mock zeroconf in all tests."""
|
||||||
|
|
|
@ -10,6 +10,7 @@ from homeassistant.setup import async_setup_component
|
||||||
from . import BASE_URL
|
from . import BASE_URL
|
||||||
|
|
||||||
from tests.test_util.aiohttp import AiohttpClientMocker
|
from tests.test_util.aiohttp import AiohttpClientMocker
|
||||||
|
from tests.typing import WebSocketGenerator
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
|
@ -53,10 +54,11 @@ async def test_get_info(
|
||||||
async def test_get_info_no_entry(
|
async def test_get_info_no_entry(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
aioclient_mock: AiohttpClientMocker,
|
aioclient_mock: AiohttpClientMocker,
|
||||||
websocket_client,
|
hass_ws_client: WebSocketGenerator,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test async_get_info."""
|
"""Test async_get_info."""
|
||||||
await async_setup_component(hass, "otbr", {})
|
await async_setup_component(hass, "otbr", {})
|
||||||
|
websocket_client = await hass_ws_client(hass)
|
||||||
await websocket_client.send_json(
|
await websocket_client.send_json(
|
||||||
{
|
{
|
||||||
"id": 5,
|
"id": 5,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue