mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Add type hints to matrix events fixtures (#121213)
This commit is contained in:
parent
d12f2384c5
commit
9a1f7f020c
@ -48,7 +48,7 @@ from homeassistant.const import (
|
|||||||
CONF_USERNAME,
|
CONF_USERNAME,
|
||||||
CONF_VERIFY_SSL,
|
CONF_VERIFY_SSL,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import Event, HomeAssistant
|
||||||
from homeassistant.setup import async_setup_component
|
from homeassistant.setup import async_setup_component
|
||||||
|
|
||||||
from tests.common import async_capture_events
|
from tests.common import async_capture_events
|
||||||
@ -294,13 +294,13 @@ async def matrix_bot(
|
|||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def matrix_events(hass: HomeAssistant):
|
def matrix_events(hass: HomeAssistant) -> list[Event]:
|
||||||
"""Track event calls."""
|
"""Track event calls."""
|
||||||
return async_capture_events(hass, MATRIX_DOMAIN)
|
return async_capture_events(hass, MATRIX_DOMAIN)
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def command_events(hass: HomeAssistant):
|
def command_events(hass: HomeAssistant) -> list[Event]:
|
||||||
"""Track event calls."""
|
"""Track event calls."""
|
||||||
return async_capture_events(hass, EVENT_MATRIX_COMMAND)
|
return async_capture_events(hass, EVENT_MATRIX_COMMAND)
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ from homeassistant.components.matrix import (
|
|||||||
)
|
)
|
||||||
from homeassistant.components.matrix.const import FORMAT_HTML, SERVICE_SEND_MESSAGE
|
from homeassistant.components.matrix.const import FORMAT_HTML, SERVICE_SEND_MESSAGE
|
||||||
from homeassistant.components.notify import ATTR_DATA, ATTR_MESSAGE, ATTR_TARGET
|
from homeassistant.components.notify import ATTR_DATA, ATTR_MESSAGE, ATTR_TARGET
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import Event, HomeAssistant
|
||||||
|
|
||||||
from .conftest import TEST_BAD_ROOM, TEST_JOINABLE_ROOMS
|
from .conftest import TEST_BAD_ROOM, TEST_JOINABLE_ROOMS
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ async def test_send_message(
|
|||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
matrix_bot: MatrixBot,
|
matrix_bot: MatrixBot,
|
||||||
image_path,
|
image_path,
|
||||||
matrix_events,
|
matrix_events: list[Event],
|
||||||
caplog: pytest.LogCaptureFixture,
|
caplog: pytest.LogCaptureFixture,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test the send_message service."""
|
"""Test the send_message service."""
|
||||||
@ -63,7 +63,7 @@ async def test_send_message(
|
|||||||
async def test_unsendable_message(
|
async def test_unsendable_message(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
matrix_bot: MatrixBot,
|
matrix_bot: MatrixBot,
|
||||||
matrix_events,
|
matrix_events: list[Event],
|
||||||
caplog: pytest.LogCaptureFixture,
|
caplog: pytest.LogCaptureFixture,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test the send_message service with an invalid room."""
|
"""Test the send_message service with an invalid room."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user