Correct type hints mqtt_client_mock and move new generator type (#87527)
* Correct mqtt_client_mock and move MqttMockType * Rename MqttMockType to MqttMockGenerator * Make types more specific * adjust returntype _setup_mqtt_entry * Correct return type _setup_mqtt_entry * Update tests/conftest.py Co-authored-by: epenet <6771947+epenet@users.noreply.github.com> * Update tests/conftest.py Co-authored-by: epenet <6771947+epenet@users.noreply.github.com> --------- Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
This commit is contained in:
parent
212e172be2
commit
4ad386d794
2 changed files with 28 additions and 17 deletions
|
@ -3,9 +3,16 @@ from __future__ import annotations
|
|||
|
||||
from collections.abc import Callable, Coroutine
|
||||
from typing import Any
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
from aiohttp import ClientWebSocketResponse
|
||||
from aiohttp.test_utils import TestClient
|
||||
|
||||
ClientSessionGenerator = Callable[..., Coroutine[Any, Any, TestClient]]
|
||||
MqttMockPahoClient = MagicMock
|
||||
"""MagicMock for `paho.mqtt.client.Client`"""
|
||||
MqttMockHAClient = MagicMock
|
||||
"""MagicMock for `homeassistant.components.mqtt.MQTT`."""
|
||||
MqttMockHAClientGenerator = Callable[..., Coroutine[Any, Any, MqttMockHAClient]]
|
||||
"""MagicMock generator for `homeassistant.components.mqtt.MQTT`."""
|
||||
WebSocketGenerator = Callable[..., Coroutine[Any, Any, ClientWebSocketResponse]]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue