1
0
mirror of https://github.com/home-assistant/core.git synced 2025-05-09 16:39:22 +00:00

19 lines
615 B
Python

"""Common methods used across the tests for ring devices."""
from unittest.mock import patch
from homeassistant.components.ring import DOMAIN
from homeassistant.setup import async_setup_component
from tests.common import MockConfigEntry
async def setup_platform(hass, platform):
"""Set up the ring platform and prerequisites."""
MockConfigEntry(domain=DOMAIN, data={"username": "foo", "token": {}}).add_to_hass(
hass
)
with patch("homeassistant.components.ring.PLATFORMS", [platform]):
assert await async_setup_component(hass, DOMAIN, {})
await hass.async_block_till_done()