Fix otbr tests (#88184)

This commit is contained in:
Erik Montnemery 2023-02-15 16:19:46 +01:00 committed by GitHub
parent 2af4d2152b
commit 6254200b37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -22,3 +22,8 @@ async def otbr_config_entry_fixture(hass):
config_entry.add_to_hass(hass)
with patch("python_otbr_api.OTBR.get_active_dataset_tlvs", return_value=DATASET):
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."""

View File

@ -10,6 +10,7 @@ from homeassistant.setup import async_setup_component
from . import BASE_URL
from tests.test_util.aiohttp import AiohttpClientMocker
from tests.typing import WebSocketGenerator
@pytest.fixture
@ -53,10 +54,11 @@ async def test_get_info(
async def test_get_info_no_entry(
hass: HomeAssistant,
aioclient_mock: AiohttpClientMocker,
websocket_client,
hass_ws_client: WebSocketGenerator,
) -> None:
"""Test async_get_info."""
await async_setup_component(hass, "otbr", {})
websocket_client = await hass_ws_client(hass)
await websocket_client.send_json(
{
"id": 5,