2023-01-18 13:43:38 +00:00
|
|
|
"""Test fixtures for the Home Assistant SkyConnect integration."""
|
2023-01-18 16:33:15 +00:00
|
|
|
from unittest.mock import patch
|
2023-01-17 13:01:36 +00:00
|
|
|
|
|
|
|
import pytest
|
|
|
|
|
|
|
|
from homeassistant.components import otbr
|
|
|
|
|
|
|
|
from tests.common import MockConfigEntry
|
|
|
|
|
|
|
|
CONFIG_ENTRY_DATA = {"url": "http://core-silabs-multiprotocol:8081"}
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture(name="thread_config_entry")
|
|
|
|
async def thread_config_entry_fixture(hass):
|
|
|
|
"""Mock Thread config entry."""
|
|
|
|
config_entry = MockConfigEntry(
|
|
|
|
data=CONFIG_ENTRY_DATA,
|
|
|
|
domain=otbr.DOMAIN,
|
|
|
|
options={},
|
|
|
|
title="Thread",
|
|
|
|
)
|
|
|
|
config_entry.add_to_hass(hass)
|
2023-01-18 16:33:15 +00:00
|
|
|
with patch("python_otbr_api.OTBR.get_active_dataset_tlvs"):
|
|
|
|
assert await hass.config_entries.async_setup(config_entry.entry_id)
|