Avoid accessing hass.data in test_play_media_didl_metadata (#66939)

pull/66918/head^2
Michael Chisholm 2022-02-21 00:14:53 +11:00 committed by GitHub
parent 5b28e2d983
commit 3d5790aaad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -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,