Use setup_test_component_platform helper for binary_sensor entity component tests instead of hass.components (#114293)

This commit is contained in:
Jan-Philipp Benecke 2024-03-27 14:24:02 +01:00 committed by GitHub
parent c222cfd692
commit 6313571fbc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 74 additions and 90 deletions

View file

@ -0,0 +1,21 @@
"""Fixtures for binary_sensor entity component tests."""
import pytest
from homeassistant.components.binary_sensor import BinarySensorDeviceClass
from .common import MockBinarySensor
@pytest.fixture
def mock_binary_sensor_entities() -> dict[str, MockBinarySensor]:
"""Return mock binary sensors."""
return {
device_class: MockBinarySensor(
name=f"{device_class} sensor",
is_on=True,
unique_id=f"unique_{device_class}",
device_class=device_class,
)
for device_class in BinarySensorDeviceClass
}