Use enums in helpers tests (#62141)

This commit is contained in:
Robert Hillis
2021-12-17 05:09:24 -05:00
committed by GitHub
parent 07532c3153
commit 626a3f35f5
2 changed files with 7 additions and 7 deletions

View File

@@ -6,7 +6,7 @@ import pytest
from homeassistant.components import sun
import homeassistant.components.automation as automation
from homeassistant.components.sensor import DEVICE_CLASS_TIMESTAMP
from homeassistant.components.sensor import SensorDeviceClass
from homeassistant.const import (
ATTR_DEVICE_CLASS,
CONF_CONDITION,
@@ -854,12 +854,12 @@ async def test_time_using_sensor(hass):
hass.states.async_set(
"sensor.am",
"2021-06-03 13:00:00.000000+00:00", # 6 am local time
{ATTR_DEVICE_CLASS: DEVICE_CLASS_TIMESTAMP},
{ATTR_DEVICE_CLASS: SensorDeviceClass.TIMESTAMP},
)
hass.states.async_set(
"sensor.pm",
"2020-06-01 01:00:00.000000+00:00", # 6 pm local time
{ATTR_DEVICE_CLASS: DEVICE_CLASS_TIMESTAMP},
{ATTR_DEVICE_CLASS: SensorDeviceClass.TIMESTAMP},
)
hass.states.async_set(
"sensor.no_device_class",
@@ -868,7 +868,7 @@ async def test_time_using_sensor(hass):
hass.states.async_set(
"sensor.invalid_timestamp",
"This is not a timestamp",
{ATTR_DEVICE_CLASS: DEVICE_CLASS_TIMESTAMP},
{ATTR_DEVICE_CLASS: SensorDeviceClass.TIMESTAMP},
)
with patch(