mirror of
https://github.com/home-assistant/core.git
synced 2025-07-26 22:57:17 +00:00
Fix local_todo todo tests (#103099)
This commit is contained in:
parent
64f8967739
commit
246ebc99cc
@ -79,13 +79,13 @@ async def ws_move_item(
|
|||||||
return move
|
return move
|
||||||
|
|
||||||
|
|
||||||
async def test_create_item(
|
async def test_add_item(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
hass_ws_client: WebSocketGenerator,
|
hass_ws_client: WebSocketGenerator,
|
||||||
setup_integration: None,
|
setup_integration: None,
|
||||||
ws_get_items: Callable[[], Awaitable[dict[str, str]]],
|
ws_get_items: Callable[[], Awaitable[dict[str, str]]],
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test creating a todo item."""
|
"""Test adding a todo item."""
|
||||||
|
|
||||||
state = hass.states.get(TEST_ENTITY)
|
state = hass.states.get(TEST_ENTITY)
|
||||||
assert state
|
assert state
|
||||||
@ -93,8 +93,8 @@ async def test_create_item(
|
|||||||
|
|
||||||
await hass.services.async_call(
|
await hass.services.async_call(
|
||||||
TODO_DOMAIN,
|
TODO_DOMAIN,
|
||||||
"create_item",
|
"add_item",
|
||||||
{"summary": "replace batteries"},
|
{"item": "replace batteries"},
|
||||||
target={"entity_id": TEST_ENTITY},
|
target={"entity_id": TEST_ENTITY},
|
||||||
blocking=True,
|
blocking=True,
|
||||||
)
|
)
|
||||||
@ -110,16 +110,16 @@ async def test_create_item(
|
|||||||
assert state.state == "1"
|
assert state.state == "1"
|
||||||
|
|
||||||
|
|
||||||
async def test_delete_item(
|
async def test_remove_item(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
setup_integration: None,
|
setup_integration: None,
|
||||||
ws_get_items: Callable[[], Awaitable[dict[str, str]]],
|
ws_get_items: Callable[[], Awaitable[dict[str, str]]],
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test deleting a todo item."""
|
"""Test removing a todo item."""
|
||||||
await hass.services.async_call(
|
await hass.services.async_call(
|
||||||
TODO_DOMAIN,
|
TODO_DOMAIN,
|
||||||
"create_item",
|
"add_item",
|
||||||
{"summary": "replace batteries"},
|
{"item": "replace batteries"},
|
||||||
target={"entity_id": TEST_ENTITY},
|
target={"entity_id": TEST_ENTITY},
|
||||||
blocking=True,
|
blocking=True,
|
||||||
)
|
)
|
||||||
@ -136,8 +136,8 @@ async def test_delete_item(
|
|||||||
|
|
||||||
await hass.services.async_call(
|
await hass.services.async_call(
|
||||||
TODO_DOMAIN,
|
TODO_DOMAIN,
|
||||||
"delete_item",
|
"remove_item",
|
||||||
{"uid": [items[0]["uid"]]},
|
{"item": [items[0]["uid"]]},
|
||||||
target={"entity_id": TEST_ENTITY},
|
target={"entity_id": TEST_ENTITY},
|
||||||
blocking=True,
|
blocking=True,
|
||||||
)
|
)
|
||||||
@ -150,17 +150,17 @@ async def test_delete_item(
|
|||||||
assert state.state == "0"
|
assert state.state == "0"
|
||||||
|
|
||||||
|
|
||||||
async def test_bulk_delete(
|
async def test_bulk_remove(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
setup_integration: None,
|
setup_integration: None,
|
||||||
ws_get_items: Callable[[], Awaitable[dict[str, str]]],
|
ws_get_items: Callable[[], Awaitable[dict[str, str]]],
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test deleting multiple todo items."""
|
"""Test removing multiple todo items."""
|
||||||
for i in range(0, 5):
|
for i in range(0, 5):
|
||||||
await hass.services.async_call(
|
await hass.services.async_call(
|
||||||
TODO_DOMAIN,
|
TODO_DOMAIN,
|
||||||
"create_item",
|
"add_item",
|
||||||
{"summary": f"soda #{i}"},
|
{"item": f"soda #{i}"},
|
||||||
target={"entity_id": TEST_ENTITY},
|
target={"entity_id": TEST_ENTITY},
|
||||||
blocking=True,
|
blocking=True,
|
||||||
)
|
)
|
||||||
@ -175,8 +175,8 @@ async def test_bulk_delete(
|
|||||||
|
|
||||||
await hass.services.async_call(
|
await hass.services.async_call(
|
||||||
TODO_DOMAIN,
|
TODO_DOMAIN,
|
||||||
"delete_item",
|
"remove_item",
|
||||||
{"uid": uids},
|
{"item": uids},
|
||||||
target={"entity_id": TEST_ENTITY},
|
target={"entity_id": TEST_ENTITY},
|
||||||
blocking=True,
|
blocking=True,
|
||||||
)
|
)
|
||||||
@ -199,8 +199,8 @@ async def test_update_item(
|
|||||||
# Create new item
|
# Create new item
|
||||||
await hass.services.async_call(
|
await hass.services.async_call(
|
||||||
TODO_DOMAIN,
|
TODO_DOMAIN,
|
||||||
"create_item",
|
"add_item",
|
||||||
{"summary": "soda"},
|
{"item": "soda"},
|
||||||
target={"entity_id": TEST_ENTITY},
|
target={"entity_id": TEST_ENTITY},
|
||||||
blocking=True,
|
blocking=True,
|
||||||
)
|
)
|
||||||
@ -220,7 +220,7 @@ async def test_update_item(
|
|||||||
await hass.services.async_call(
|
await hass.services.async_call(
|
||||||
TODO_DOMAIN,
|
TODO_DOMAIN,
|
||||||
"update_item",
|
"update_item",
|
||||||
{"uid": item["uid"], "status": "completed"},
|
{"item": item["uid"], "status": "completed"},
|
||||||
target={"entity_id": TEST_ENTITY},
|
target={"entity_id": TEST_ENTITY},
|
||||||
blocking=True,
|
blocking=True,
|
||||||
)
|
)
|
||||||
@ -276,8 +276,8 @@ async def test_move_item(
|
|||||||
for i in range(1, 5):
|
for i in range(1, 5):
|
||||||
await hass.services.async_call(
|
await hass.services.async_call(
|
||||||
TODO_DOMAIN,
|
TODO_DOMAIN,
|
||||||
"create_item",
|
"add_item",
|
||||||
{"summary": f"item {i}"},
|
{"item": f"item {i}"},
|
||||||
target={"entity_id": TEST_ENTITY},
|
target={"entity_id": TEST_ENTITY},
|
||||||
blocking=True,
|
blocking=True,
|
||||||
)
|
)
|
||||||
@ -334,8 +334,8 @@ async def test_move_item_previous_unknown(
|
|||||||
|
|
||||||
await hass.services.async_call(
|
await hass.services.async_call(
|
||||||
TODO_DOMAIN,
|
TODO_DOMAIN,
|
||||||
"create_item",
|
"add_item",
|
||||||
{"summary": "item 1"},
|
{"item": "item 1"},
|
||||||
target={"entity_id": TEST_ENTITY},
|
target={"entity_id": TEST_ENTITY},
|
||||||
blocking=True,
|
blocking=True,
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user