Use service_calls fixture in media_extractor tests (#120935)
This commit is contained in:
parent
8a23e37837
commit
c4903dd982
2 changed files with 16 additions and 23 deletions
|
@ -7,14 +7,12 @@ from unittest.mock import AsyncMock, patch
|
|||
import pytest
|
||||
|
||||
from homeassistant.components.media_extractor import DOMAIN
|
||||
from homeassistant.core import HomeAssistant, ServiceCall
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
from . import MockYoutubeDL
|
||||
from .const import AUDIO_QUERY
|
||||
|
||||
from tests.common import async_mock_service
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
async def setup_homeassistant(hass: HomeAssistant):
|
||||
|
@ -31,12 +29,6 @@ async def setup_media_player(hass: HomeAssistant) -> None:
|
|||
await hass.async_block_till_done()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def calls(hass: HomeAssistant) -> list[ServiceCall]:
|
||||
"""Track calls to a mock service."""
|
||||
return async_mock_service(hass, "media_player", "play_media")
|
||||
|
||||
|
||||
@pytest.fixture(name="mock_youtube_dl")
|
||||
async def setup_mock_yt_dlp(hass: HomeAssistant) -> MockYoutubeDL:
|
||||
"""Mock YoutubeDL."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue