From 01acbc8bba4c53129b0189feef8d0f53139cd943 Mon Sep 17 00:00:00 2001 From: Jan-Philipp Benecke Date: Fri, 22 Mar 2024 17:51:39 +0100 Subject: [PATCH] Remove deprecated `hass.components` from zeroconf tests (#114013) --- tests/components/zeroconf/test_init.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tests/components/zeroconf/test_init.py b/tests/components/zeroconf/test_init.py index da817c84448..0f70d862c4c 100644 --- a/tests/components/zeroconf/test_init.py +++ b/tests/components/zeroconf/test_init.py @@ -188,9 +188,7 @@ async def test_setup(hass: HomeAssistant, mock_async_zeroconf: None) -> None: # Test instance is set. assert "zeroconf" in hass.data - assert ( - await hass.components.zeroconf.async_get_async_instance() is mock_async_zeroconf - ) + assert await zeroconf.async_get_async_instance(hass) is mock_async_zeroconf async def test_setup_with_overly_long_url_and_name( @@ -931,9 +929,7 @@ async def test_info_from_service_can_return_ipv6(hass: HomeAssistant) -> None: async def test_get_instance(hass: HomeAssistant, mock_async_zeroconf: None) -> None: """Test we get an instance.""" assert await async_setup_component(hass, zeroconf.DOMAIN, {zeroconf.DOMAIN: {}}) - assert ( - await hass.components.zeroconf.async_get_async_instance() is mock_async_zeroconf - ) + assert await zeroconf.async_get_async_instance(hass) is mock_async_zeroconf hass.bus.async_fire(EVENT_HOMEASSISTANT_STOP) await hass.async_block_till_done() assert len(mock_async_zeroconf.ha_async_close.mock_calls) == 0