diff --git a/tests/components/apprise/test_notify.py b/tests/components/apprise/test_notify.py index 3d0ebd419d5..ab827a95210 100644 --- a/tests/components/apprise/test_notify.py +++ b/tests/components/apprise/test_notify.py @@ -15,7 +15,10 @@ async def test_apprise_config_load_fail01(hass: HomeAssistant) -> None: BASE_COMPONENT: {"name": "test", "platform": "apprise", "config": "/path/"} } - with patch("apprise.AppriseConfig.add", return_value=False): + with patch( + "homeassistant.components.apprise.notify.apprise.AppriseConfig.add", + return_value=False, + ): assert await async_setup_component(hass, BASE_COMPONENT, config) await hass.async_block_till_done() @@ -30,8 +33,12 @@ async def test_apprise_config_load_fail02(hass: HomeAssistant) -> None: BASE_COMPONENT: {"name": "test", "platform": "apprise", "config": "/path/"} } - with patch("apprise.Apprise.add", return_value=False), patch( - "apprise.AppriseConfig.add", return_value=True + with patch( + "homeassistant.components.apprise.notify.apprise.Apprise.add", + return_value=False, + ), patch( + "homeassistant.components.apprise.notify.apprise.AppriseConfig.add", + return_value=True, ): assert await async_setup_component(hass, BASE_COMPONENT, config) await hass.async_block_till_done() @@ -68,7 +75,10 @@ async def test_apprise_url_load_fail(hass: HomeAssistant) -> None: "url": "mailto://user:pass@example.com", } } - with patch("apprise.Apprise.add", return_value=False): + with patch( + "homeassistant.components.apprise.notify.apprise.Apprise.add", + return_value=False, + ): assert await async_setup_component(hass, BASE_COMPONENT, config) await hass.async_block_till_done() @@ -90,7 +100,9 @@ async def test_apprise_notification(hass: HomeAssistant) -> None: # Our Message data = {"title": "Test Title", "message": "Test Message"} - with patch("apprise.Apprise") as mock_apprise: + with patch( + "homeassistant.components.apprise.notify.apprise.Apprise" + ) as mock_apprise: obj = MagicMock() obj.add.return_value = True obj.notify.return_value = True @@ -131,7 +143,9 @@ async def test_apprise_notification_with_target( # Our Message, only notify the services tagged with "devops" data = {"title": "Test Title", "message": "Test Message", "target": ["devops"]} - with patch("apprise.Apprise") as mock_apprise: + with patch( + "homeassistant.components.apprise.notify.apprise.Apprise" + ) as mock_apprise: apprise_obj = MagicMock() apprise_obj.add.return_value = True apprise_obj.notify.return_value = True