From 3d5790aaad4bf8c6d5f51f92830fd0e659b91bda Mon Sep 17 00:00:00 2001 From: Michael Chisholm Date: Mon, 21 Feb 2022 00:14:53 +1100 Subject: [PATCH] Avoid accessing hass.data in test_play_media_didl_metadata (#66939) --- tests/components/dlna_dmr/test_media_player.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/components/dlna_dmr/test_media_player.py b/tests/components/dlna_dmr/test_media_player.py index 0abda9e1ed3..c68a311d2b6 100644 --- a/tests/components/dlna_dmr/test_media_player.py +++ b/tests/components/dlna_dmr/test_media_player.py @@ -823,10 +823,11 @@ async def test_play_media_didl_metadata( await async_setup_component(hass, MS_DOMAIN, {MS_DOMAIN: {}}) await hass.async_block_till_done() - local_source = hass.data[MS_DOMAIN][MS_DOMAIN] - - with patch.object(local_source, "async_resolve_media", return_value=play_media): + with patch( + "homeassistant.components.media_source.async_resolve_media", + return_value=play_media, + ): await hass.services.async_call( MP_DOMAIN, mp_const.SERVICE_PLAY_MEDIA,