Remove homeassistant from conversation dependencies (#92170)

* Remove homeassistant from conversation dependencies

* Fix tests
This commit is contained in:
Erik Montnemery 2023-04-28 18:17:48 +02:00 committed by GitHub
parent e6438dabff
commit f8f7de5d5a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 26 additions and 1 deletions

View file

@ -2,7 +2,7 @@
"domain": "conversation",
"name": "Conversation",
"codeowners": ["@home-assistant/core", "@synesthesiam"],
"dependencies": ["homeassistant", "http"],
"dependencies": ["http"],
"documentation": "https://www.home-assistant.io/integrations/conversation",
"integration_type": "system",
"iot_class": "local_push",

View file

@ -243,6 +243,7 @@ async def init_supporting_components(
)
mock_platform(hass, "test.config_flow")
assert await async_setup_component(hass, "homeassistant", {})
assert await async_setup_component(hass, tts.DOMAIN, {"tts": {"platform": "test"}})
assert await async_setup_component(hass, stt.DOMAIN, {"stt": {"platform": "test"}})
assert await async_setup_component(hass, "media_source", {})

View file

@ -25,6 +25,12 @@ from .conftest import MockSttPlatform, MockSttProvider, MockTTSPlatform, MockTTS
from tests.common import MockModule, flush_store, mock_integration, mock_platform
@pytest.fixture(autouse=True)
async def load_homeassistant(hass) -> None:
"""Load the homeassistant integration."""
assert await async_setup_component(hass, "homeassistant", {})
async def test_load_datasets(hass: HomeAssistant, init_components) -> None:
"""Make sure that we can load/save data correctly."""

View file

@ -1162,6 +1162,7 @@ async def test_ws_api(
hass: HomeAssistant, hass_ws_client: WebSocketGenerator, payload
) -> None:
"""Test the Websocket conversation API."""
assert await async_setup_component(hass, "homeassistant", {})
assert await async_setup_component(hass, "conversation", {})
client = await hass_ws_client(hass)
@ -1192,6 +1193,7 @@ async def test_ws_prepare(
hass: HomeAssistant, hass_ws_client: WebSocketGenerator, agent_id
) -> None:
"""Test the Websocket prepare conversation API."""
assert await async_setup_component(hass, "homeassistant", {})
assert await async_setup_component(hass, "conversation", {})
agent = await conversation._get_agent_manager(hass).async_get_agent()
assert isinstance(agent, conversation.DefaultAgent)
@ -1320,6 +1322,7 @@ async def test_custom_sentences_config(
async def test_prepare_reload(hass: HomeAssistant) -> None:
"""Test calling the reload service."""
language = hass.config.language
assert await async_setup_component(hass, "homeassistant", {})
assert await async_setup_component(hass, "conversation", {})
# Load intents
@ -1340,6 +1343,7 @@ async def test_prepare_reload(hass: HomeAssistant) -> None:
async def test_prepare_fail(hass: HomeAssistant) -> None:
"""Test calling prepare with a non-existent language."""
assert await async_setup_component(hass, "homeassistant", {})
assert await async_setup_component(hass, "conversation", {})
# Load intents
@ -1387,6 +1391,7 @@ async def test_language_region(
async def test_reload_on_new_component(hass: HomeAssistant) -> None:
"""Test intents being reloaded when a new component is loaded."""
language = hass.config.language
assert await async_setup_component(hass, "homeassistant", {})
assert await async_setup_component(hass, "conversation", {})
# Load intents

View file

@ -15,6 +15,7 @@ from homeassistant.components.esphome import (
)
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_PORT
from homeassistant.core import HomeAssistant
from homeassistant.setup import async_setup_component
from . import DASHBOARD_HOST, DASHBOARD_PORT, DASHBOARD_SLUG
@ -31,6 +32,12 @@ def esphome_mock_async_zeroconf(mock_async_zeroconf):
"""Auto mock zeroconf."""
@pytest.fixture(autouse=True)
async def load_homeassistant(hass) -> None:
"""Load the homeassistant integration."""
assert await async_setup_component(hass, "homeassistant", {})
@pytest.fixture
def mock_config_entry(hass) -> MockConfigEntry:
"""Return the default mocked config entry."""

View file

@ -16,6 +16,12 @@ from homeassistant.setup import async_setup_component
from tests.common import MockConfigEntry
@pytest.fixture(autouse=True)
async def load_homeassistant(hass) -> None:
"""Load the homeassistant integration."""
assert await async_setup_component(hass, "homeassistant", {})
@pytest.fixture
def config_entry(hass: HomeAssistant) -> MockConfigEntry:
"""Create a config entry."""