Replace the usage of unit constants by enumerations in Tests [h-l] (#85934)
This commit is contained in:
parent
72d3fa6d89
commit
e35ab75c0b
16 changed files with 174 additions and 150 deletions
|
@ -4,7 +4,7 @@ from unittest.mock import MagicMock
|
|||
import pytest
|
||||
|
||||
from homeassistant.components.sensor import DOMAIN as PLATFORM_DOMAIN, SensorDeviceClass
|
||||
from homeassistant.const import MASS_POUNDS, PERCENTAGE, STATE_UNKNOWN
|
||||
from homeassistant.const import PERCENTAGE, STATE_UNKNOWN, UnitOfMass
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
||||
from .conftest import setup_integration
|
||||
|
@ -92,7 +92,7 @@ async def test_litter_robot_sensor(
|
|||
assert sensor.attributes["unit_of_measurement"] == PERCENTAGE
|
||||
sensor = hass.states.get("sensor.test_pet_weight")
|
||||
assert sensor.state == "12.0"
|
||||
assert sensor.attributes["unit_of_measurement"] == MASS_POUNDS
|
||||
assert sensor.attributes["unit_of_measurement"] == UnitOfMass.POUNDS
|
||||
|
||||
|
||||
async def test_feeder_robot_sensor(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue