1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-26 05:57:01 +00:00

Use disabled_by constants (#49584)

Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
Ville Skyttä
2021-04-23 10:56:42 +03:00
committed by GitHub
parent d52bc2373f
commit a396619251
25 changed files with 92 additions and 75 deletions

View File

@@ -2,6 +2,7 @@
import pytest
from homeassistant.components.config import device_registry
from homeassistant.helpers import device_registry as helpers_dr
from tests.common import mock_device_registry
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
@@ -94,7 +95,7 @@ async def test_update_device(hass, client, registry):
"device_id": device.id,
"area_id": "12345A",
"name_by_user": "Test Friendly Name",
"disabled_by": "user",
"disabled_by": helpers_dr.DISABLED_USER,
"type": "config/device_registry/update",
}
)
@@ -104,5 +105,5 @@ async def test_update_device(hass, client, registry):
assert msg["result"]["id"] == device.id
assert msg["result"]["area_id"] == "12345A"
assert msg["result"]["name_by_user"] == "Test Friendly Name"
assert msg["result"]["disabled_by"] == "user"
assert msg["result"]["disabled_by"] == helpers_dr.DISABLED_USER
assert len(registry.devices) == 1