Replace the usage of unit constants by enumerations in Tests [a-e] (#85932)
This commit is contained in:
parent
b20eb54800
commit
2850583085
17 changed files with 164 additions and 122 deletions
|
@ -11,7 +11,7 @@ from homeassistant.const import (
|
|||
ATTR_LATITUDE,
|
||||
ATTR_LONGITUDE,
|
||||
ATTR_UNIT_OF_MEASUREMENT,
|
||||
LENGTH_KILOMETERS,
|
||||
UnitOfLength,
|
||||
)
|
||||
from homeassistant.setup import async_setup_component
|
||||
import homeassistant.util.dt as dt_util
|
||||
|
@ -45,7 +45,7 @@ async def test_setup_platform(hass):
|
|||
continue
|
||||
assert abs(state.attributes[ATTR_LATITUDE] - hass.config.latitude) < 1.0
|
||||
assert abs(state.attributes[ATTR_LONGITUDE] - hass.config.longitude) < 1.0
|
||||
assert state.attributes[ATTR_UNIT_OF_MEASUREMENT] == LENGTH_KILOMETERS
|
||||
assert state.attributes[ATTR_UNIT_OF_MEASUREMENT] == UnitOfLength.KILOMETERS
|
||||
|
||||
# Update (replaces 1 device).
|
||||
async_fire_time_changed(hass, utcnow + DEFAULT_UPDATE_INTERVAL)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue