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

Add alias to DOMAIN import in tests [a-d] (#125573)

This commit is contained in:
epenet
2024-09-09 15:20:40 +02:00
committed by GitHub
parent fe2402b611
commit aab939cf6c
27 changed files with 353 additions and 235 deletions

View File

@@ -11,7 +11,7 @@ from homeassistant.components.update import (
ATTR_RELEASE_SUMMARY,
ATTR_RELEASE_URL,
ATTR_TITLE,
DOMAIN,
DOMAIN as UPDATE_DOMAIN,
SERVICE_INSTALL,
UpdateDeviceClass,
)
@@ -41,7 +41,9 @@ async def update_only() -> None:
@pytest.fixture(autouse=True)
async def setup_demo_update(hass: HomeAssistant, update_only) -> None:
"""Initialize setup demo update entity."""
assert await async_setup_component(hass, DOMAIN, {"update": {"platform": "demo"}})
assert await async_setup_component(
hass, UPDATE_DOMAIN, {"update": {"platform": "demo"}}
)
await hass.async_block_till_done()
@@ -140,7 +142,7 @@ async def test_update_with_progress(hass: HomeAssistant) -> None:
with patch("homeassistant.components.demo.update.FAKE_INSTALL_SLEEP_TIME", new=0):
await hass.services.async_call(
DOMAIN,
UPDATE_DOMAIN,
SERVICE_INSTALL,
{ATTR_ENTITY_ID: "update.demo_update_with_progress"},
blocking=True,
@@ -184,7 +186,7 @@ async def test_update_with_progress_raising(hass: HomeAssistant) -> None:
pytest.raises(RuntimeError),
):
await hass.services.async_call(
DOMAIN,
UPDATE_DOMAIN,
SERVICE_INSTALL,
{ATTR_ENTITY_ID: "update.demo_update_with_progress"},
blocking=True,