core/tests/components/sense/__init__.py
Keilin Bickar 8aa25af014
Create tests for sense integration (#128418)
* 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>
2024-10-23 18:22:21 +02:00

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