2022-02-21 17:13:02 +00:00
|
|
|
"""Fixtures for the Radio Browser integration tests."""
|
2024-03-08 13:47:22 +00:00
|
|
|
|
2022-02-21 17:13:02 +00:00
|
|
|
from __future__ import annotations
|
|
|
|
|
|
|
|
from unittest.mock import AsyncMock, patch
|
|
|
|
|
|
|
|
import pytest
|
2024-06-06 15:41:37 +00:00
|
|
|
from typing_extensions import Generator
|
2022-02-21 17:13:02 +00:00
|
|
|
|
|
|
|
from homeassistant.components.radio_browser.const import DOMAIN
|
|
|
|
|
|
|
|
from tests.common import MockConfigEntry
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
def mock_config_entry() -> MockConfigEntry:
|
|
|
|
"""Return the default mocked config entry."""
|
|
|
|
return MockConfigEntry(
|
|
|
|
title="My Radios",
|
|
|
|
domain=DOMAIN,
|
|
|
|
data={},
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
2024-06-06 15:41:37 +00:00
|
|
|
def mock_setup_entry() -> Generator[AsyncMock]:
|
2022-02-21 17:13:02 +00:00
|
|
|
"""Mock setting up a config entry."""
|
|
|
|
with patch(
|
|
|
|
"homeassistant.components.radio_browser.async_setup_entry", return_value=True
|
|
|
|
) as mock_setup:
|
|
|
|
yield mock_setup
|