mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 01:08:12 +00:00
Add type hints for MockAgent in conversation tests (#118701)
This commit is contained in:
parent
f178467b0e
commit
5d594a509c
@ -138,6 +138,7 @@ _TEST_FIXTURES: dict[str, list[str] | str] = {
|
||||
"mock_bleak_scanner_start": "MagicMock",
|
||||
"mock_bluetooth": "None",
|
||||
"mock_bluetooth_adapters": "None",
|
||||
"mock_conversation_agent": "MockAgent",
|
||||
"mock_device_tracker_conf": "list[Device]",
|
||||
"mock_get_source_ip": "_patch",
|
||||
"mock_hass_config": "None",
|
||||
|
@ -16,7 +16,7 @@ from tests.common import MockConfigEntry
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_agent_support_all(hass: HomeAssistant):
|
||||
def mock_agent_support_all(hass: HomeAssistant) -> MockAgent:
|
||||
"""Mock agent that supports all languages."""
|
||||
entry = MockConfigEntry(entry_id="mock-entry-support-all")
|
||||
entry.add_to_hass(hass)
|
||||
|
@ -24,7 +24,7 @@ from homeassistant.helpers import (
|
||||
)
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
from . import expose_entity, expose_new
|
||||
from . import MockAgent, expose_entity, expose_new
|
||||
|
||||
from tests.common import (
|
||||
MockConfigEntry,
|
||||
@ -94,7 +94,7 @@ async def test_http_processing_intent_target_ha_agent(
|
||||
init_components,
|
||||
hass_client: ClientSessionGenerator,
|
||||
hass_admin_user: MockUser,
|
||||
mock_conversation_agent,
|
||||
mock_conversation_agent: MockAgent,
|
||||
entity_registry: er.EntityRegistry,
|
||||
snapshot: SnapshotAssertion,
|
||||
) -> None:
|
||||
@ -663,7 +663,7 @@ async def test_custom_agent(
|
||||
hass: HomeAssistant,
|
||||
hass_client: ClientSessionGenerator,
|
||||
hass_admin_user: MockUser,
|
||||
mock_conversation_agent,
|
||||
mock_conversation_agent: MockAgent,
|
||||
snapshot: SnapshotAssertion,
|
||||
) -> None:
|
||||
"""Test a custom conversation agent."""
|
||||
@ -1081,8 +1081,8 @@ async def test_agent_id_validator_invalid_agent(
|
||||
async def test_get_agent_list(
|
||||
hass: HomeAssistant,
|
||||
init_components,
|
||||
mock_conversation_agent,
|
||||
mock_agent_support_all,
|
||||
mock_conversation_agent: MockAgent,
|
||||
mock_agent_support_all: MockAgent,
|
||||
hass_ws_client: WebSocketGenerator,
|
||||
snapshot: SnapshotAssertion,
|
||||
) -> None:
|
||||
@ -1139,7 +1139,7 @@ async def test_get_agent_list(
|
||||
async def test_get_agent_info(
|
||||
hass: HomeAssistant,
|
||||
init_components,
|
||||
mock_conversation_agent,
|
||||
mock_conversation_agent: MockAgent,
|
||||
snapshot: SnapshotAssertion,
|
||||
) -> None:
|
||||
"""Test get agent info."""
|
||||
|
@ -24,6 +24,7 @@ from homeassistant.setup import async_setup_component
|
||||
from .const import CALL_SERVICE, FIRE_EVENT, REGISTER_CLEARTEXT, RENDER_TEMPLATE, UPDATE
|
||||
|
||||
from tests.common import async_capture_events, async_mock_service
|
||||
from tests.components.conversation import MockAgent
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@ -1023,7 +1024,7 @@ async def test_webhook_handle_conversation_process(
|
||||
homeassistant,
|
||||
create_registrations,
|
||||
webhook_client,
|
||||
mock_conversation_agent,
|
||||
mock_conversation_agent: MockAgent,
|
||||
) -> None:
|
||||
"""Test that we can converse."""
|
||||
webhook_client.server.app.router._frozen = False
|
||||
|
Loading…
x
Reference in New Issue
Block a user