Use new enums in rdw tests (#62707)

This commit is contained in:
Dave T 2021-12-23 22:07:56 +00:00 committed by GitHub
parent 20e6b50003
commit caa2157b5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 6 deletions

View file

@ -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

View file

@ -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