mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Get Litter-Robot to 100% code coverage and minor code cleanup (#58704)
This commit is contained in:
@@ -12,6 +12,7 @@ from homeassistant.components.litterrobot.vacuum import (
|
||||
SERVICE_SET_WAIT_TIME,
|
||||
)
|
||||
from homeassistant.components.vacuum import (
|
||||
ATTR_STATUS,
|
||||
DOMAIN as PLATFORM_DOMAIN,
|
||||
SERVICE_START,
|
||||
SERVICE_TURN_OFF,
|
||||
@@ -46,6 +47,17 @@ async def test_vacuum(hass: HomeAssistant, mock_account):
|
||||
assert vacuum.attributes["is_sleeping"] is False
|
||||
|
||||
|
||||
async def test_vacuum_status_when_sleeping(
|
||||
hass: HomeAssistant, mock_account_with_sleeping_robot
|
||||
):
|
||||
"""Tests the vacuum status when sleeping."""
|
||||
await setup_integration(hass, mock_account_with_sleeping_robot, PLATFORM_DOMAIN)
|
||||
|
||||
vacuum = hass.states.get(VACUUM_ENTITY_ID)
|
||||
assert vacuum
|
||||
assert vacuum.attributes.get(ATTR_STATUS) == "Ready (Sleeping)"
|
||||
|
||||
|
||||
async def test_no_robots(hass: HomeAssistant, mock_account_with_no_robots):
|
||||
"""Tests the vacuum entity was set up."""
|
||||
await setup_integration(hass, mock_account_with_no_robots, PLATFORM_DOMAIN)
|
||||
|
||||
Reference in New Issue
Block a user