mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 17:27:52 +00:00

* Create tests for sense integration * Rearrange files * Update to use snapshots * Update tests/components/sense/__init__.py Co-authored-by: epenet <6771947+epenet@users.noreply.github.com> * Update tests/components/sense/__init__.py Co-authored-by: epenet <6771947+epenet@users.noreply.github.com> * Update tests/components/sense/test_binary_sensor.py Co-authored-by: epenet <6771947+epenet@users.noreply.github.com> * Update tests/components/sense/test_sensor.py Co-authored-by: epenet <6771947+epenet@users.noreply.github.com> * Add missing imports --------- Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
24 lines
706 B
Python
24 lines
706 B
Python
"""Tests for the Sense integration."""
|
|
|
|
from unittest.mock import patch
|
|
|
|
from homeassistant.components.sense.const import DOMAIN
|
|
from homeassistant.const import Platform
|
|
from homeassistant.core import HomeAssistant
|
|
from homeassistant.setup import async_setup_component
|
|
|
|
from tests.common import MockConfigEntry
|
|
|
|
|
|
async def setup_platform(
|
|
hass: HomeAssistant, config_entry: MockConfigEntry, platform: Platform
|
|
) -> MockConfigEntry:
|
|
"""Set up the Sense platform."""
|
|
config_entry.add_to_hass(hass)
|
|
|
|
with patch("homeassistant.components.sense.PLATFORMS", [platform]):
|
|
assert await async_setup_component(hass, DOMAIN, {})
|
|
await hass.async_block_till_done()
|
|
|
|
return config_entry
|