hass-core/tests/components/conversation/conftest.py
Paulus Schoutsen fc38b4327f
Add support for multiple conversation agents (#87337)
* Add support for multiple conversation agents

* Lock initializing default agent

* Allow unsetting agent when never set
2023-02-03 23:35:29 -05:00

19 lines
415 B
Python

"""Conversation test helpers."""
import pytest
from homeassistant.components import conversation
from . import MockAgent
from tests.common import MockConfigEntry
@pytest.fixture
def mock_agent(hass):
"""Mock agent."""
entry = MockConfigEntry(entry_id="mock-entry")
entry.add_to_hass(hass)
agent = MockAgent(entry.entry_id)
conversation.async_set_agent(hass, entry, agent)
return agent