Black
This commit is contained in:
1 parent
da05dfe708
commit
4de97abc3a
2676 files changed
+163166
-140084
No files matched your search
@@ -23,7 +23,7 @@ async def test_entity_and_device_attributes(hass, scene):
|
||||
# Act
|
||||
await setup_platform(hass, SCENE_DOMAIN, scenes=[scene])
|
||||
# Assert
|
||||
entry = entity_registry.async_get('scene.test_scene')
|
||||
entry = entity_registry.async_get("scene.test_scene")
|
||||
assert entry
|
||||
assert entry.unique_id == scene.scene_id
|
||||
|
||||
@@ -32,13 +32,15 @@ async def test_scene_activate(hass, scene):
|
||||
"""Test the scene is activated."""
|
||||
await setup_platform(hass, SCENE_DOMAIN, scenes=[scene])
|
||||
await hass.services.async_call(
|
||||
SCENE_DOMAIN, SERVICE_TURN_ON, {
|
||||
ATTR_ENTITY_ID: 'scene.test_scene'},
|
||||
blocking=True)
|
||||
state = hass.states.get('scene.test_scene')
|
||||
assert state.attributes['icon'] == scene.icon
|
||||
assert state.attributes['color'] == scene.color
|
||||
assert state.attributes['location_id'] == scene.location_id
|
||||
SCENE_DOMAIN,
|
||||
SERVICE_TURN_ON,
|
||||
{ATTR_ENTITY_ID: "scene.test_scene"},
|
||||
blocking=True,
|
||||
)
|
||||
state = hass.states.get("scene.test_scene")
|
||||
assert state.attributes["icon"] == scene.icon
|
||||
assert state.attributes["color"] == scene.color
|
||||
assert state.attributes["location_id"] == scene.location_id
|
||||
# pylint: disable=protected-access
|
||||
assert scene.execute.call_count == 1 # type: ignore
|
||||
|
||||
@@ -48,7 +50,6 @@ async def test_unload_config_entry(hass, scene):
|
||||
# Arrange
|
||||
config_entry = await setup_platform(hass, SCENE_DOMAIN, scenes=[scene])
|
||||
# Act
|
||||
await hass.config_entries.async_forward_entry_unload(
|
||||
config_entry, SCENE_DOMAIN)
|
||||
await hass.config_entries.async_forward_entry_unload(config_entry, SCENE_DOMAIN)
|
||||
# Assert
|
||||
assert not hass.states.get('scene.test_scene')
|
||||
assert not hass.states.get("scene.test_scene")
|
||||
Reference in new issue
Block a user