From 710e245819b36b6bf9945f2ae4d40d1e261457e4 Mon Sep 17 00:00:00 2001 From: Thomas55555 <59625598+Thomas55555@users.noreply.github.com> Date: Fri, 21 Jun 2024 17:02:20 +0200 Subject: [PATCH] Also test if command can be send successfully in Husqvarna Automower (#120107) --- tests/components/husqvarna_automower/test_lawn_mower.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/components/husqvarna_automower/test_lawn_mower.py b/tests/components/husqvarna_automower/test_lawn_mower.py index 849339e4d96..ff5a67971be 100644 --- a/tests/components/husqvarna_automower/test_lawn_mower.py +++ b/tests/components/husqvarna_automower/test_lawn_mower.py @@ -70,6 +70,15 @@ async def test_lawn_mower_commands( ) -> None: """Test lawn_mower commands.""" await setup_integration(hass, mock_config_entry) + await hass.services.async_call( + domain="lawn_mower", + service=service, + service_data={"entity_id": "lawn_mower.test_mower_1"}, + blocking=True, + ) + mocked_method = getattr(mock_automower_client.commands, aioautomower_command) + mocked_method.assert_called_once_with(TEST_MOWER_ID) + getattr( mock_automower_client.commands, aioautomower_command ).side_effect = ApiException("Test error")