From caa2157b5b958618e4525feba113d27027cbb28d Mon Sep 17 00:00:00 2001 From: Dave T <17680170+davet2001@users.noreply.github.com> Date: Thu, 23 Dec 2021 22:07:56 +0000 Subject: [PATCH] Use new enums in rdw tests (#62707) --- tests/components/rdw/test_binary_sensor.py | 4 ++-- tests/components/rdw/test_sensor.py | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/components/rdw/test_binary_sensor.py b/tests/components/rdw/test_binary_sensor.py index b3c4d5a9b3c..abf15d869ce 100644 --- a/tests/components/rdw/test_binary_sensor.py +++ b/tests/components/rdw/test_binary_sensor.py @@ -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 diff --git a/tests/components/rdw/test_sensor.py b/tests/components/rdw/test_sensor.py index 5eeea579194..32d4c368d73 100644 --- a/tests/components/rdw/test_sensor.py +++ b/tests/components/rdw/test_sensor.py @@ -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