hass-core/tests/components/otbr/conftest.py
Erik Montnemery 527de22adf
Add thread dataset store (#87187)
* Add thread dataset store

* Address review comments

* Bump python-otbr-api to 1.0.3

* Remove stuff which we don't need yet
2023-02-03 09:47:41 -05:00

24 lines
745 B
Python

"""Test fixtures for the Open Thread Border Router integration."""
from unittest.mock import patch
import pytest
from homeassistant.components import otbr
from . import CONFIG_ENTRY_DATA, DATASET
from tests.common import MockConfigEntry
@pytest.fixture(name="otbr_config_entry")
async def otbr_config_entry_fixture(hass):
"""Mock Open Thread Border Router config entry."""
config_entry = MockConfigEntry(
data=CONFIG_ENTRY_DATA,
domain=otbr.DOMAIN,
options={},
title="Open Thread Border Router",
)
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)