1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Drop UNIT_ prefix for percentage constant (#39383)

This commit is contained in:
springstan
2020-09-05 21:09:14 +02:00
committed by GitHub
parent cdc93d7110
commit d2b1918e9c
183 changed files with 639 additions and 661 deletions

View File

@@ -1,7 +1,7 @@
"""Tests for the Start.ca sensor platform."""
from homeassistant.bootstrap import async_setup_component
from homeassistant.components.startca.sensor import StartcaData
from homeassistant.const import DATA_GIGABYTES, HTTP_NOT_FOUND, UNIT_PERCENTAGE
from homeassistant.const import DATA_GIGABYTES, HTTP_NOT_FOUND, PERCENTAGE
from homeassistant.helpers.aiohttp_client import async_get_clientsession
@@ -53,7 +53,7 @@ async def test_capped_setup(hass, aioclient_mock):
await hass.async_block_till_done()
state = hass.states.get("sensor.start_ca_usage_ratio")
assert state.attributes.get("unit_of_measurement") == UNIT_PERCENTAGE
assert state.attributes.get("unit_of_measurement") == PERCENTAGE
assert state.state == "76.24"
state = hass.states.get("sensor.start_ca_usage")
@@ -149,7 +149,7 @@ async def test_unlimited_setup(hass, aioclient_mock):
await hass.async_block_till_done()
state = hass.states.get("sensor.start_ca_usage_ratio")
assert state.attributes.get("unit_of_measurement") == UNIT_PERCENTAGE
assert state.attributes.get("unit_of_measurement") == PERCENTAGE
assert state.state == "0"
state = hass.states.get("sensor.start_ca_usage")