Fix motionblinds ble test (#123990)

* Fix motionblinds ble test

* Fix motionblinds ble test
This commit is contained in:
Joost Lekkerkerker 2024-08-15 18:16:49 +02:00 committed by GitHub
parent a50aeb0a66
commit 874ae15d6a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 14 additions and 10 deletions

View File

@ -28,10 +28,10 @@ from tests.common import MockConfigEntry
],
)
async def test_button(
hass: HomeAssistant,
mock_config_entry: MockConfigEntry,
mock_motion_device: Mock,
name: str,
hass: HomeAssistant,
button: str,
) -> None:
"""Test states of the button."""

View File

@ -31,6 +31,7 @@ from . import setup_integration
from tests.common import MockConfigEntry
@pytest.mark.usefixtures("motionblinds_ble_connect")
@pytest.mark.parametrize("blind_type", [MotionBlindType.VENETIAN])
@pytest.mark.parametrize(
("service", "method", "kwargs"),
@ -46,10 +47,10 @@ from tests.common import MockConfigEntry
],
)
async def test_cover_service(
hass: HomeAssistant,
mock_config_entry: MockConfigEntry,
mock_motion_device: Mock,
name: str,
hass: HomeAssistant,
service: str,
method: str,
kwargs: dict[str, Any],
@ -67,6 +68,7 @@ async def test_cover_service(
getattr(mock_motion_device, method).assert_called_once()
@pytest.mark.usefixtures("motionblinds_ble_connect")
@pytest.mark.parametrize(
("running_type", "state"),
[
@ -77,10 +79,10 @@ async def test_cover_service(
],
)
async def test_cover_update_running(
hass: HomeAssistant,
mock_config_entry: MockConfigEntry,
mock_motion_device: Mock,
name: str,
hass: HomeAssistant,
running_type: str | None,
state: str,
) -> None:
@ -94,6 +96,7 @@ async def test_cover_update_running(
assert hass.states.get(f"cover.{name}").state == state
@pytest.mark.usefixtures("motionblinds_ble_connect")
@pytest.mark.parametrize(
("position", "tilt", "state"),
[
@ -104,10 +107,10 @@ async def test_cover_update_running(
],
)
async def test_cover_update_position(
hass: HomeAssistant,
mock_config_entry: MockConfigEntry,
mock_motion_device: Mock,
name: str,
hass: HomeAssistant,
position: int,
tilt: int,
state: str,

View File

@ -33,10 +33,10 @@ from tests.common import MockConfigEntry
],
)
async def test_entity_update(
hass: HomeAssistant,
mock_config_entry: MockConfigEntry,
mock_motion_device: Mock,
name: str,
hass: HomeAssistant,
platform: Platform,
entity: str,
) -> None:

View File

@ -13,7 +13,8 @@ from tests.components.bluetooth import inject_bluetooth_service_info
async def test_options_update_listener(
mock_config_entry: MockConfigEntry, hass: HomeAssistant
hass: HomeAssistant,
mock_config_entry: MockConfigEntry,
) -> None:
"""Test options_update_listener."""
@ -33,8 +34,8 @@ async def test_options_update_listener(
async def test_update_ble_device(
mock_config_entry: MockConfigEntry,
hass: HomeAssistant,
mock_config_entry: MockConfigEntry,
service_info: BluetoothServiceInfoBleak,
) -> None:
"""Test async_update_ble_device."""

View File

@ -24,10 +24,10 @@ from tests.common import MockConfigEntry
@pytest.mark.parametrize(("select", "args"), [(ATTR_SPEED, MotionSpeedLevel.HIGH)])
async def test_select(
hass: HomeAssistant,
mock_config_entry: MockConfigEntry,
mock_motion_device: Mock,
name: str,
hass: HomeAssistant,
select: str,
args: Any,
) -> None:
@ -58,10 +58,10 @@ async def test_select(
],
)
async def test_select_update(
hass: HomeAssistant,
mock_config_entry: MockConfigEntry,
mock_motion_device: Mock,
name: str,
hass: HomeAssistant,
select: str,
register_callback: Callable[[MotionDevice], Callable[..., None]],
value: type[Enum],

View File

@ -87,10 +87,10 @@ from tests.common import MockConfigEntry
],
)
async def test_sensor(
hass: HomeAssistant,
mock_config_entry: MockConfigEntry,
mock_motion_device: Mock,
name: str,
hass: HomeAssistant,
sensor: str,
register_callback: Callable[[MotionDevice], Callable[..., None]],
initial_value: str,