* Add test cases for Tradfri cover * Simplify test * Fix typo * Fix typos * Update tests/components/tradfri/test_cover.py Co-authored-by: Martin Hjelmare <marhje52@gmail.com> * Fix * Remove unused function * Move common tools to separate file * Simplify parametrization * Use int * Remove loop * Use context manager * Simplify * Update docstring Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
24 lines
658 B
Python
24 lines
658 B
Python
"""Common tools used for the Tradfri test suite."""
|
|
from homeassistant.components import tradfri
|
|
|
|
from . import GATEWAY_ID
|
|
|
|
from tests.common import MockConfigEntry
|
|
|
|
|
|
async def setup_integration(hass):
|
|
"""Load the Tradfri integration with a mock gateway."""
|
|
entry = MockConfigEntry(
|
|
domain=tradfri.DOMAIN,
|
|
data={
|
|
"host": "mock-host",
|
|
"identity": "mock-identity",
|
|
"key": "mock-key",
|
|
"import_groups": True,
|
|
"gateway_id": GATEWAY_ID,
|
|
},
|
|
)
|
|
|
|
entry.add_to_hass(hass)
|
|
await hass.config_entries.async_setup(entry.entry_id)
|
|
await hass.async_block_till_done()
|