Use new constants in todo tests (#121727)
This commit is contained in:
parent
2fce71ea52
commit
0462582da3
9 changed files with 446 additions and 372 deletions
|
@ -5,7 +5,8 @@ from unittest.mock import MagicMock, Mock
|
|||
import pytest
|
||||
from syrupy.assertion import SnapshotAssertion
|
||||
|
||||
from homeassistant.components.todo import DOMAIN
|
||||
from homeassistant.components.todo import ATTR_ITEM, DOMAIN, TodoServices
|
||||
from homeassistant.const import ATTR_ENTITY_ID
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.exceptions import ServiceValidationError
|
||||
|
||||
|
@ -91,9 +92,9 @@ async def test_create_todo_list_item(
|
|||
|
||||
await hass.services.async_call(
|
||||
DOMAIN,
|
||||
"add_item",
|
||||
{"item": "Melk"},
|
||||
target={"entity_id": ENTITY_ID},
|
||||
TodoServices.ADD_ITEM,
|
||||
{ATTR_ITEM: "Melk"},
|
||||
target={ATTR_ENTITY_ID: ENTITY_ID},
|
||||
blocking=True,
|
||||
)
|
||||
|
||||
|
@ -119,8 +120,8 @@ async def test_create_todo_list_item_not_found(
|
|||
with pytest.raises(ServiceValidationError):
|
||||
await hass.services.async_call(
|
||||
DOMAIN,
|
||||
"add_item",
|
||||
{"item": "Melk"},
|
||||
target={"entity_id": ENTITY_ID},
|
||||
TodoServices.ADD_ITEM,
|
||||
{ATTR_ITEM: "Melk"},
|
||||
target={ATTR_ENTITY_ID: ENTITY_ID},
|
||||
blocking=True,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue