From 874ae15d6a8915d2172077bc0ff830175f4abdb8 Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Thu, 15 Aug 2024 18:16:49 +0200 Subject: [PATCH] Fix motionblinds ble test (#123990) * Fix motionblinds ble test * Fix motionblinds ble test --- tests/components/motionblinds_ble/test_button.py | 2 +- tests/components/motionblinds_ble/test_cover.py | 9 ++++++--- tests/components/motionblinds_ble/test_entity.py | 2 +- tests/components/motionblinds_ble/test_init.py | 5 +++-- tests/components/motionblinds_ble/test_select.py | 4 ++-- tests/components/motionblinds_ble/test_sensor.py | 2 +- 6 files changed, 14 insertions(+), 10 deletions(-) diff --git a/tests/components/motionblinds_ble/test_button.py b/tests/components/motionblinds_ble/test_button.py index f0f80762759..9c27056c929 100644 --- a/tests/components/motionblinds_ble/test_button.py +++ b/tests/components/motionblinds_ble/test_button.py @@ -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.""" diff --git a/tests/components/motionblinds_ble/test_cover.py b/tests/components/motionblinds_ble/test_cover.py index 2e6f1ad587a..2f6b33b3017 100644 --- a/tests/components/motionblinds_ble/test_cover.py +++ b/tests/components/motionblinds_ble/test_cover.py @@ -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, diff --git a/tests/components/motionblinds_ble/test_entity.py b/tests/components/motionblinds_ble/test_entity.py index d5927e438a5..1bfd3b185e5 100644 --- a/tests/components/motionblinds_ble/test_entity.py +++ b/tests/components/motionblinds_ble/test_entity.py @@ -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: diff --git a/tests/components/motionblinds_ble/test_init.py b/tests/components/motionblinds_ble/test_init.py index 706dfdc2f01..09596bd8d5e 100644 --- a/tests/components/motionblinds_ble/test_init.py +++ b/tests/components/motionblinds_ble/test_init.py @@ -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.""" diff --git a/tests/components/motionblinds_ble/test_select.py b/tests/components/motionblinds_ble/test_select.py index 813df89e387..2bd1bb30ec2 100644 --- a/tests/components/motionblinds_ble/test_select.py +++ b/tests/components/motionblinds_ble/test_select.py @@ -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], diff --git a/tests/components/motionblinds_ble/test_sensor.py b/tests/components/motionblinds_ble/test_sensor.py index 4859fc643c9..54d2fbcb064 100644 --- a/tests/components/motionblinds_ble/test_sensor.py +++ b/tests/components/motionblinds_ble/test_sensor.py @@ -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,