Use new enums in rdw tests (#62707)
This commit is contained in:
parent
20e6b50003
commit
caa2157b5b
2 changed files with 5 additions and 6 deletions
|
@ -1,5 +1,5 @@
|
|||
"""Tests for the sensors provided by the RDW integration."""
|
||||
from homeassistant.components.binary_sensor import DEVICE_CLASS_PROBLEM
|
||||
from homeassistant.components.binary_sensor import BinarySensorDeviceClass
|
||||
from homeassistant.components.rdw.const import DOMAIN
|
||||
from homeassistant.const import ATTR_DEVICE_CLASS, ATTR_FRIENDLY_NAME, ATTR_ICON
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
@ -33,7 +33,7 @@ async def test_vehicle_binary_sensors(
|
|||
assert entry.unique_id == "11ZKZ3_pending_recall"
|
||||
assert state.state == "off"
|
||||
assert state.attributes.get(ATTR_FRIENDLY_NAME) == "Pending Recall"
|
||||
assert state.attributes.get(ATTR_DEVICE_CLASS) == DEVICE_CLASS_PROBLEM
|
||||
assert state.attributes.get(ATTR_DEVICE_CLASS) == BinarySensorDeviceClass.PROBLEM
|
||||
assert ATTR_ICON not in state.attributes
|
||||
|
||||
assert entry.device_id
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
"""Tests for the sensors provided by the RDW integration."""
|
||||
from homeassistant.components.rdw.const import DOMAIN
|
||||
from homeassistant.components.sensor import ATTR_STATE_CLASS
|
||||
from homeassistant.components.sensor import ATTR_STATE_CLASS, SensorDeviceClass
|
||||
from homeassistant.const import (
|
||||
ATTR_DEVICE_CLASS,
|
||||
ATTR_FRIENDLY_NAME,
|
||||
ATTR_ICON,
|
||||
ATTR_UNIT_OF_MEASUREMENT,
|
||||
DEVICE_CLASS_DATE,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers import device_registry as dr, entity_registry as er
|
||||
|
@ -29,7 +28,7 @@ async def test_vehicle_sensors(
|
|||
assert entry.unique_id == "11ZKZ3_apk_expiration"
|
||||
assert state.state == "2022-01-04"
|
||||
assert state.attributes.get(ATTR_FRIENDLY_NAME) == "APK Expiration"
|
||||
assert state.attributes.get(ATTR_DEVICE_CLASS) == DEVICE_CLASS_DATE
|
||||
assert state.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.DATE
|
||||
assert ATTR_ICON not in state.attributes
|
||||
assert ATTR_STATE_CLASS not in state.attributes
|
||||
assert ATTR_UNIT_OF_MEASUREMENT not in state.attributes
|
||||
|
@ -41,7 +40,7 @@ async def test_vehicle_sensors(
|
|||
assert entry.unique_id == "11ZKZ3_ascription_date"
|
||||
assert state.state == "2021-11-04"
|
||||
assert state.attributes.get(ATTR_FRIENDLY_NAME) == "Ascription Date"
|
||||
assert state.attributes.get(ATTR_DEVICE_CLASS) == DEVICE_CLASS_DATE
|
||||
assert state.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.DATE
|
||||
assert ATTR_ICON not in state.attributes
|
||||
assert ATTR_STATE_CLASS not in state.attributes
|
||||
assert ATTR_UNIT_OF_MEASUREMENT not in state.attributes
|
||||
|
|
Loading…
Add table
Reference in a new issue