mirror of
https://github.com/home-assistant/core.git
synced 2025-08-07 06:35:10 +02:00
Fix test
This commit is contained in:
@@ -4,7 +4,12 @@ from unittest.mock import MagicMock
|
||||
|
||||
import pytest
|
||||
|
||||
from homeassistant.components.wolflink.const import COORDINATOR, DEVICE_ID, DOMAIN
|
||||
from homeassistant.components.wolflink.const import (
|
||||
COORDINATOR,
|
||||
DEVICE_ID,
|
||||
DOMAIN,
|
||||
MANUFACTURER,
|
||||
)
|
||||
from homeassistant.components.wolflink.sensor import (
|
||||
WolfLinkEnergy,
|
||||
WolfLinkHours,
|
||||
@@ -49,6 +54,14 @@ async def mock_config_entry(
|
||||
)
|
||||
config_entry.add_to_hass(hass)
|
||||
|
||||
device_id = device_registry.async_get_or_create(
|
||||
config_entry_id=config_entry.entry_id,
|
||||
identifiers={(DOMAIN, CONFIG[DEVICE_ID])},
|
||||
configuration_url="https://www.wolf-smartset.com/",
|
||||
manufacturer=MANUFACTURER,
|
||||
).id
|
||||
assert device_registry.async_get(device_id).identifiers == {(DOMAIN, "1234")}
|
||||
|
||||
|
||||
def test_wolflink_sensor_initialization(mock_coordinator) -> None:
|
||||
"""Test WolflinkSensor initialization."""
|
||||
|
Reference in New Issue
Block a user