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( async def test_button(
hass: HomeAssistant,
mock_config_entry: MockConfigEntry, mock_config_entry: MockConfigEntry,
mock_motion_device: Mock, mock_motion_device: Mock,
name: str, name: str,
hass: HomeAssistant,
button: str, button: str,
) -> None: ) -> None:
"""Test states of the button.""" """Test states of the button."""

View File

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

View File

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

View File

@ -13,7 +13,8 @@ from tests.components.bluetooth import inject_bluetooth_service_info
async def test_options_update_listener( async def test_options_update_listener(
mock_config_entry: MockConfigEntry, hass: HomeAssistant hass: HomeAssistant,
mock_config_entry: MockConfigEntry,
) -> None: ) -> None:
"""Test options_update_listener.""" """Test options_update_listener."""
@ -33,8 +34,8 @@ async def test_options_update_listener(
async def test_update_ble_device( async def test_update_ble_device(
mock_config_entry: MockConfigEntry,
hass: HomeAssistant, hass: HomeAssistant,
mock_config_entry: MockConfigEntry,
service_info: BluetoothServiceInfoBleak, service_info: BluetoothServiceInfoBleak,
) -> None: ) -> None:
"""Test async_update_ble_device.""" """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)]) @pytest.mark.parametrize(("select", "args"), [(ATTR_SPEED, MotionSpeedLevel.HIGH)])
async def test_select( async def test_select(
hass: HomeAssistant,
mock_config_entry: MockConfigEntry, mock_config_entry: MockConfigEntry,
mock_motion_device: Mock, mock_motion_device: Mock,
name: str, name: str,
hass: HomeAssistant,
select: str, select: str,
args: Any, args: Any,
) -> None: ) -> None:
@ -58,10 +58,10 @@ async def test_select(
], ],
) )
async def test_select_update( async def test_select_update(
hass: HomeAssistant,
mock_config_entry: MockConfigEntry, mock_config_entry: MockConfigEntry,
mock_motion_device: Mock, mock_motion_device: Mock,
name: str, name: str,
hass: HomeAssistant,
select: str, select: str,
register_callback: Callable[[MotionDevice], Callable[..., None]], register_callback: Callable[[MotionDevice], Callable[..., None]],
value: type[Enum], value: type[Enum],

View File

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