Adjust pylint plugin for components fixtures (#90217)

* Adjust pylint plugin for components fixtures

* Adjust components

* Use MagicMock

* Adjust

* Use None
This commit is contained in:
epenet 2023-03-26 15:21:19 +02:00 committed by GitHub
parent e0ec3488d3
commit 69a46d4002
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 59 additions and 59 deletions

View file

@ -104,6 +104,7 @@ _TEST_FIXTURES: dict[str, list[str] | str] = {
"enable_statistics": "bool", "enable_statistics": "bool",
"enable_schema_validation": "bool", "enable_schema_validation": "bool",
"entity_registry": "EntityRegistry", "entity_registry": "EntityRegistry",
"entity_registry_enabled_by_default": "None",
"freezer": "FrozenDateTimeFactory", "freezer": "FrozenDateTimeFactory",
"hass_access_token": "str", "hass_access_token": "str",
"hass_admin_credential": "Credentials", "hass_admin_credential": "Credentials",

View file

@ -1,14 +1,12 @@
"""The sensor tests for the Airzone platform.""" """The sensor tests for the Airzone platform."""
from unittest.mock import AsyncMock
from homeassistant.core import HomeAssistant from homeassistant.core import HomeAssistant
from .util import async_init_integration from .util import async_init_integration
async def test_airzone_create_sensors( async def test_airzone_create_sensors(
hass: HomeAssistant, entity_registry_enabled_by_default: AsyncMock hass: HomeAssistant, entity_registry_enabled_by_default: None
) -> None: ) -> None:
"""Test creation of sensors.""" """Test creation of sensors."""

View file

@ -1,12 +1,12 @@
"""Fixtures for component testing.""" """Fixtures for component testing."""
from collections.abc import Generator from collections.abc import Generator
from unittest.mock import AsyncMock, patch from unittest.mock import patch
import pytest import pytest
@pytest.fixture(scope="session", autouse=True) @pytest.fixture(scope="session", autouse=True)
def patch_zeroconf_multiple_catcher(): def patch_zeroconf_multiple_catcher() -> Generator[None, None, None]:
"""Patch zeroconf wrapper that detects if multiple instances are used.""" """Patch zeroconf wrapper that detects if multiple instances are used."""
with patch( with patch(
"homeassistant.components.zeroconf.install_multiple_zeroconf_catcher", "homeassistant.components.zeroconf.install_multiple_zeroconf_catcher",
@ -16,7 +16,7 @@ def patch_zeroconf_multiple_catcher():
@pytest.fixture(autouse=True) @pytest.fixture(autouse=True)
def prevent_io(): def prevent_io() -> Generator[None, None, None]:
"""Fixture to prevent certain I/O from happening.""" """Fixture to prevent certain I/O from happening."""
with patch( with patch(
"homeassistant.components.http.ban.load_yaml_config_file", "homeassistant.components.http.ban.load_yaml_config_file",
@ -25,10 +25,10 @@ def prevent_io():
@pytest.fixture @pytest.fixture
def entity_registry_enabled_by_default() -> Generator[AsyncMock, None, None]: def entity_registry_enabled_by_default() -> Generator[None, None, None]:
"""Test fixture that ensures all entities are enabled in the registry.""" """Test fixture that ensures all entities are enabled in the registry."""
with patch( with patch(
"homeassistant.helpers.entity.Entity.entity_registry_enabled_default", "homeassistant.helpers.entity.Entity.entity_registry_enabled_default",
return_value=True, return_value=True,
) as mock_entity_registry_enabled_by_default: ):
yield mock_entity_registry_enabled_by_default yield

View file

@ -1,5 +1,4 @@
"""Sensor tests for the Goalzero integration.""" """Sensor tests for the Goalzero integration."""
from unittest.mock import AsyncMock
from homeassistant.components.goalzero.const import DEFAULT_NAME from homeassistant.components.goalzero.const import DEFAULT_NAME
from homeassistant.components.sensor import ( from homeassistant.components.sensor import (
@ -29,7 +28,7 @@ from tests.test_util.aiohttp import AiohttpClientMocker
async def test_sensors( async def test_sensors(
hass: HomeAssistant, hass: HomeAssistant,
aioclient_mock: AiohttpClientMocker, aioclient_mock: AiohttpClientMocker,
entity_registry_enabled_by_default: AsyncMock, entity_registry_enabled_by_default: None,
) -> None: ) -> None:
"""Test we get sensor data.""" """Test we get sensor data."""
await async_init_integration(hass, aioclient_mock) await async_init_integration(hass, aioclient_mock)

View file

@ -1,4 +1,5 @@
"""Tests for gree component.""" """Tests for gree component."""
from greeclimate.exceptions import DeviceTimeoutError from greeclimate.exceptions import DeviceTimeoutError
import pytest import pytest
@ -54,7 +55,7 @@ async def test_health_mode_disabled_by_default(hass):
], ],
) )
async def test_send_switch_on( async def test_send_switch_on(
hass: HomeAssistant, entity, entity_registry_enabled_by_default hass: HomeAssistant, entity, entity_registry_enabled_by_default: None
) -> None: ) -> None:
"""Test for sending power on command to the device.""" """Test for sending power on command to the device."""
await async_setup_gree(hass) await async_setup_gree(hass)
@ -82,7 +83,7 @@ async def test_send_switch_on(
], ],
) )
async def test_send_switch_on_device_timeout( async def test_send_switch_on_device_timeout(
hass: HomeAssistant, device, entity, entity_registry_enabled_by_default hass: HomeAssistant, device, entity, entity_registry_enabled_by_default: None
) -> None: ) -> None:
"""Test for sending power on command to the device with a device timeout.""" """Test for sending power on command to the device with a device timeout."""
device().push_state_update.side_effect = DeviceTimeoutError device().push_state_update.side_effect = DeviceTimeoutError
@ -112,7 +113,7 @@ async def test_send_switch_on_device_timeout(
], ],
) )
async def test_send_switch_off( async def test_send_switch_off(
hass: HomeAssistant, entity, entity_registry_enabled_by_default hass: HomeAssistant, entity, entity_registry_enabled_by_default: None
) -> None: ) -> None:
"""Test for sending power on command to the device.""" """Test for sending power on command to the device."""
await async_setup_gree(hass) await async_setup_gree(hass)
@ -140,7 +141,7 @@ async def test_send_switch_off(
], ],
) )
async def test_send_switch_toggle( async def test_send_switch_toggle(
hass: HomeAssistant, entity, entity_registry_enabled_by_default hass: HomeAssistant, entity, entity_registry_enabled_by_default: None
) -> None: ) -> None:
"""Test for sending power on command to the device.""" """Test for sending power on command to the device."""
await async_setup_gree(hass) await async_setup_gree(hass)
@ -193,7 +194,7 @@ async def test_send_switch_toggle(
], ],
) )
async def test_entity_name( async def test_entity_name(
hass: HomeAssistant, entity, name, entity_registry_enabled_by_default hass: HomeAssistant, entity, name, entity_registry_enabled_by_default: None
) -> None: ) -> None:
"""Test for name property.""" """Test for name property."""
await async_setup_gree(hass) await async_setup_gree(hass)

View file

@ -364,7 +364,7 @@ def test_thread_status_to_str() -> None:
async def test_rssi_sensor( async def test_rssi_sensor(
hass: HomeAssistant, hass: HomeAssistant,
utcnow, utcnow,
entity_registry_enabled_by_default, entity_registry_enabled_by_default: None,
enable_bluetooth: None, enable_bluetooth: None,
) -> None: ) -> None:
"""Test an rssi sensor.""" """Test an rssi sensor."""
@ -389,7 +389,7 @@ async def test_rssi_sensor(
async def test_migrate_rssi_sensor_unique_id( async def test_migrate_rssi_sensor_unique_id(
hass: HomeAssistant, hass: HomeAssistant,
utcnow, utcnow,
entity_registry_enabled_by_default, entity_registry_enabled_by_default: None,
enable_bluetooth: None, enable_bluetooth: None,
) -> None: ) -> None:
"""Test an rssi sensor unique id migration.""" """Test an rssi sensor unique id migration."""

View file

@ -1,5 +1,4 @@
"""Test Kostal Plenticore number.""" """Test Kostal Plenticore number."""
from collections.abc import Generator from collections.abc import Generator
from datetime import timedelta from datetime import timedelta
from unittest.mock import patch from unittest.mock import patch
@ -90,7 +89,7 @@ async def test_setup_all_entries(
mock_config_entry: MockConfigEntry, mock_config_entry: MockConfigEntry,
mock_plenticore_client: ApiClient, mock_plenticore_client: ApiClient,
mock_get_setting_values: list, mock_get_setting_values: list,
entity_registry_enabled_by_default, entity_registry_enabled_by_default: None,
) -> None: ) -> None:
"""Test if all available entries are setup.""" """Test if all available entries are setup."""
@ -109,7 +108,7 @@ async def test_setup_no_entries(
mock_config_entry: MockConfigEntry, mock_config_entry: MockConfigEntry,
mock_plenticore_client: ApiClient, mock_plenticore_client: ApiClient,
mock_get_setting_values: list, mock_get_setting_values: list,
entity_registry_enabled_by_default, entity_registry_enabled_by_default: None,
) -> None: ) -> None:
"""Test that no entries are setup if Plenticore does not provide data.""" """Test that no entries are setup if Plenticore does not provide data."""
@ -130,7 +129,7 @@ async def test_number_has_value(
mock_config_entry: MockConfigEntry, mock_config_entry: MockConfigEntry,
mock_plenticore_client: ApiClient, mock_plenticore_client: ApiClient,
mock_get_setting_values: list, mock_get_setting_values: list,
entity_registry_enabled_by_default, entity_registry_enabled_by_default: None,
) -> None: ) -> None:
"""Test if number has a value if data is provided on update.""" """Test if number has a value if data is provided on update."""
@ -155,7 +154,7 @@ async def test_number_is_unavailable(
mock_config_entry: MockConfigEntry, mock_config_entry: MockConfigEntry,
mock_plenticore_client: ApiClient, mock_plenticore_client: ApiClient,
mock_get_setting_values: list, mock_get_setting_values: list,
entity_registry_enabled_by_default, entity_registry_enabled_by_default: None,
) -> None: ) -> None:
"""Test if number is unavailable if no data is provided on update.""" """Test if number is unavailable if no data is provided on update."""
@ -176,7 +175,7 @@ async def test_set_value(
mock_config_entry: MockConfigEntry, mock_config_entry: MockConfigEntry,
mock_plenticore_client: ApiClient, mock_plenticore_client: ApiClient,
mock_get_setting_values: list, mock_get_setting_values: list,
entity_registry_enabled_by_default, entity_registry_enabled_by_default: None,
) -> None: ) -> None:
"""Test if a new value could be set.""" """Test if a new value could be set."""

View file

@ -1,5 +1,5 @@
"""Test the Litter-Robot binary sensor entity.""" """Test the Litter-Robot binary sensor entity."""
from unittest.mock import AsyncMock, MagicMock from unittest.mock import MagicMock
import pytest import pytest
@ -17,7 +17,7 @@ from .conftest import setup_integration
async def test_binary_sensors( async def test_binary_sensors(
hass: HomeAssistant, hass: HomeAssistant,
mock_account: MagicMock, mock_account: MagicMock,
entity_registry_enabled_by_default: AsyncMock, entity_registry_enabled_by_default: None,
) -> None: ) -> None:
"""Tests binary sensors.""" """Tests binary sensors."""
await setup_integration(hass, mock_account, PLATFORM_DOMAIN) await setup_integration(hass, mock_account, PLATFORM_DOMAIN)

View file

@ -1,4 +1,5 @@
"""Test the OralB sensors.""" """Test the OralB sensors."""
from homeassistant.components.oralb.const import DOMAIN from homeassistant.components.oralb.const import DOMAIN
from homeassistant.const import ATTR_FRIENDLY_NAME from homeassistant.const import ATTR_FRIENDLY_NAME
from homeassistant.core import HomeAssistant from homeassistant.core import HomeAssistant
@ -16,7 +17,9 @@ from tests.components.bluetooth import (
) )
async def test_sensors(hass: HomeAssistant, entity_registry_enabled_by_default) -> None: async def test_sensors(
hass: HomeAssistant, entity_registry_enabled_by_default: None
) -> None:
"""Test setting up creates the sensors.""" """Test setting up creates the sensors."""
entry = MockConfigEntry( entry = MockConfigEntry(
domain=DOMAIN, domain=DOMAIN,
@ -47,7 +50,7 @@ async def test_sensors(hass: HomeAssistant, entity_registry_enabled_by_default)
async def test_sensors_io_series_4( async def test_sensors_io_series_4(
hass: HomeAssistant, entity_registry_enabled_by_default hass: HomeAssistant, entity_registry_enabled_by_default: None
) -> None: ) -> None:
"""Test setting up creates the sensors with an io series 4.""" """Test setting up creates the sensors with an io series 4."""
entry = MockConfigEntry( entry = MockConfigEntry(

View file

@ -20,7 +20,9 @@ from .mocks import _mock_powerwall_with_fixtures
from tests.common import MockConfigEntry from tests.common import MockConfigEntry
async def test_sensors(hass: HomeAssistant, entity_registry_enabled_by_default) -> None: async def test_sensors(
hass: HomeAssistant, entity_registry_enabled_by_default: None
) -> None:
"""Test creation of the sensors.""" """Test creation of the sensors."""
mock_powerwall = await _mock_powerwall_with_fixtures(hass) mock_powerwall = await _mock_powerwall_with_fixtures(hass)

View file

@ -1,7 +1,5 @@
"""The binary sensor tests for the QNAP QSW platform.""" """The binary sensor tests for the QNAP QSW platform."""
from unittest.mock import AsyncMock
from homeassistant.components.qnap_qsw.const import ATTR_MESSAGE from homeassistant.components.qnap_qsw.const import ATTR_MESSAGE
from homeassistant.const import STATE_OFF, STATE_ON from homeassistant.const import STATE_OFF, STATE_ON
from homeassistant.core import HomeAssistant from homeassistant.core import HomeAssistant
@ -12,7 +10,7 @@ from .util import async_init_integration
async def test_qnap_qsw_create_binary_sensors( async def test_qnap_qsw_create_binary_sensors(
hass: HomeAssistant, hass: HomeAssistant,
entity_registry_enabled_by_default: AsyncMock, entity_registry_enabled_by_default: None,
entity_registry: er.EntityRegistry, entity_registry: er.EntityRegistry,
) -> None: ) -> None:
"""Test creation of binary sensors.""" """Test creation of binary sensors."""

View file

@ -1,7 +1,5 @@
"""The sensor tests for the QNAP QSW platform.""" """The sensor tests for the QNAP QSW platform."""
from unittest.mock import AsyncMock
from homeassistant.components.qnap_qsw.const import ATTR_MAX from homeassistant.components.qnap_qsw.const import ATTR_MAX
from homeassistant.core import HomeAssistant from homeassistant.core import HomeAssistant
@ -10,7 +8,7 @@ from .util import async_init_integration
async def test_qnap_qsw_create_sensors( async def test_qnap_qsw_create_sensors(
hass: HomeAssistant, hass: HomeAssistant,
entity_registry_enabled_by_default: AsyncMock, entity_registry_enabled_by_default: None,
) -> None: ) -> None:
"""Test creation of sensors.""" """Test creation of sensors."""

View file

@ -1,5 +1,4 @@
"""The tests for Radarr sensor platform.""" """The tests for Radarr sensor platform."""
from unittest.mock import AsyncMock
from homeassistant.components.sensor import SensorDeviceClass from homeassistant.components.sensor import SensorDeviceClass
from homeassistant.const import ATTR_DEVICE_CLASS, ATTR_UNIT_OF_MEASUREMENT from homeassistant.const import ATTR_DEVICE_CLASS, ATTR_UNIT_OF_MEASUREMENT
@ -13,7 +12,7 @@ from tests.test_util.aiohttp import AiohttpClientMocker
async def test_sensors( async def test_sensors(
hass: HomeAssistant, hass: HomeAssistant,
aioclient_mock: AiohttpClientMocker, aioclient_mock: AiohttpClientMocker,
entity_registry_enabled_by_default: AsyncMock, entity_registry_enabled_by_default: None,
) -> None: ) -> None:
"""Test for successfully setting up the Radarr platform.""" """Test for successfully setting up the Radarr platform."""
await setup_integration(hass, aioclient_mock) await setup_integration(hass, aioclient_mock)

View file

@ -2,7 +2,7 @@
from __future__ import annotations from __future__ import annotations
from datetime import timedelta from datetime import timedelta
from unittest.mock import AsyncMock, patch from unittest.mock import patch
from pysensibo.model import SensiboData from pysensibo.model import SensiboData
import pytest import pytest
@ -16,7 +16,7 @@ from tests.common import async_fire_time_changed
async def test_binary_sensor( async def test_binary_sensor(
hass: HomeAssistant, hass: HomeAssistant,
entity_registry_enabled_by_default: AsyncMock, entity_registry_enabled_by_default: None,
load_int: ConfigEntry, load_int: ConfigEntry,
monkeypatch: pytest.MonkeyPatch, monkeypatch: pytest.MonkeyPatch,
get_data: SensiboData, get_data: SensiboData,

View file

@ -2,7 +2,7 @@
from __future__ import annotations from __future__ import annotations
from datetime import datetime, timedelta from datetime import datetime, timedelta
from unittest.mock import AsyncMock, patch from unittest.mock import patch
from pysensibo.model import SensiboData from pysensibo.model import SensiboData
import pytest import pytest
@ -720,7 +720,7 @@ async def test_climate_no_fan_no_swing(
async def test_climate_set_timer( async def test_climate_set_timer(
hass: HomeAssistant, hass: HomeAssistant,
entity_registry_enabled_by_default: AsyncMock, entity_registry_enabled_by_default: None,
load_int: ConfigEntry, load_int: ConfigEntry,
monkeypatch: pytest.MonkeyPatch, monkeypatch: pytest.MonkeyPatch,
get_data: SensiboData, get_data: SensiboData,
@ -824,7 +824,7 @@ async def test_climate_set_timer(
async def test_climate_pure_boost( async def test_climate_pure_boost(
hass: HomeAssistant, hass: HomeAssistant,
entity_registry_enabled_by_default: AsyncMock, entity_registry_enabled_by_default: None,
load_int: ConfigEntry, load_int: ConfigEntry,
monkeypatch: pytest.MonkeyPatch, monkeypatch: pytest.MonkeyPatch,
get_data: SensiboData, get_data: SensiboData,
@ -928,7 +928,7 @@ async def test_climate_pure_boost(
async def test_climate_climate_react( async def test_climate_climate_react(
hass: HomeAssistant, hass: HomeAssistant,
entity_registry_enabled_by_default: AsyncMock, entity_registry_enabled_by_default: None,
load_int: ConfigEntry, load_int: ConfigEntry,
monkeypatch: pytest.MonkeyPatch, monkeypatch: pytest.MonkeyPatch,
get_data: SensiboData, get_data: SensiboData,
@ -1091,7 +1091,7 @@ async def test_climate_climate_react(
async def test_climate_climate_react_fahrenheit( async def test_climate_climate_react_fahrenheit(
hass: HomeAssistant, hass: HomeAssistant,
entity_registry_enabled_by_default: AsyncMock, entity_registry_enabled_by_default: None,
load_int: ConfigEntry, load_int: ConfigEntry,
monkeypatch: pytest.MonkeyPatch, monkeypatch: pytest.MonkeyPatch,
get_data: SensiboData, get_data: SensiboData,
@ -1234,7 +1234,7 @@ async def test_climate_climate_react_fahrenheit(
async def test_climate_full_ac_state( async def test_climate_full_ac_state(
hass: HomeAssistant, hass: HomeAssistant,
entity_registry_enabled_by_default: AsyncMock, entity_registry_enabled_by_default: None,
load_int: ConfigEntry, load_int: ConfigEntry,
monkeypatch: pytest.MonkeyPatch, monkeypatch: pytest.MonkeyPatch,
get_data: SensiboData, get_data: SensiboData,

View file

@ -2,7 +2,7 @@
from __future__ import annotations from __future__ import annotations
from datetime import timedelta from datetime import timedelta
from unittest.mock import AsyncMock, patch from unittest.mock import patch
from pysensibo.model import SensiboData from pysensibo.model import SensiboData
import pytest import pytest
@ -23,7 +23,7 @@ from tests.common import async_fire_time_changed
async def test_number( async def test_number(
hass: HomeAssistant, hass: HomeAssistant,
entity_registry_enabled_by_default: AsyncMock, entity_registry_enabled_by_default: None,
load_int: ConfigEntry, load_int: ConfigEntry,
monkeypatch: pytest.MonkeyPatch, monkeypatch: pytest.MonkeyPatch,
get_data: SensiboData, get_data: SensiboData,
@ -53,7 +53,7 @@ async def test_number(
async def test_number_set_value( async def test_number_set_value(
hass: HomeAssistant, hass: HomeAssistant,
entity_registry_enabled_by_default: AsyncMock, entity_registry_enabled_by_default: None,
load_int: ConfigEntry, load_int: ConfigEntry,
get_data: SensiboData, get_data: SensiboData,
) -> None: ) -> None:

View file

@ -2,7 +2,7 @@
from __future__ import annotations from __future__ import annotations
from datetime import timedelta from datetime import timedelta
from unittest.mock import AsyncMock, patch from unittest.mock import patch
from pysensibo.model import SensiboData from pysensibo.model import SensiboData
import pytest import pytest
@ -16,7 +16,7 @@ from tests.common import async_fire_time_changed
async def test_sensor( async def test_sensor(
hass: HomeAssistant, hass: HomeAssistant,
entity_registry_enabled_by_default: AsyncMock, entity_registry_enabled_by_default: None,
load_int: ConfigEntry, load_int: ConfigEntry,
monkeypatch: pytest.pytest.MonkeyPatch, monkeypatch: pytest.pytest.MonkeyPatch,
get_data: SensiboData, get_data: SensiboData,

View file

@ -1,6 +1,6 @@
"""Tests for the Sonarr sensor platform.""" """Tests for the Sonarr sensor platform."""
from datetime import timedelta from datetime import timedelta
from unittest.mock import AsyncMock, MagicMock, patch from unittest.mock import MagicMock, patch
from aiopyarr import ArrException from aiopyarr import ArrException
import pytest import pytest
@ -25,7 +25,7 @@ async def test_sensors(
hass: HomeAssistant, hass: HomeAssistant,
mock_config_entry: MockConfigEntry, mock_config_entry: MockConfigEntry,
mock_sonarr: MagicMock, mock_sonarr: MagicMock,
entity_registry_enabled_by_default: AsyncMock, entity_registry_enabled_by_default: None,
) -> None: ) -> None:
"""Test the creation and values of the sensors.""" """Test the creation and values of the sensors."""
registry = er.async_get(hass) registry = er.async_get(hass)

View file

@ -1,4 +1,5 @@
"""Test the switchbot sensors.""" """Test the switchbot sensors."""
from homeassistant.components.sensor import ATTR_STATE_CLASS from homeassistant.components.sensor import ATTR_STATE_CLASS
from homeassistant.components.switchbot.const import DOMAIN from homeassistant.components.switchbot.const import DOMAIN
from homeassistant.const import ( from homeassistant.const import (
@ -18,7 +19,9 @@ from tests.common import MockConfigEntry
from tests.components.bluetooth import inject_bluetooth_service_info from tests.components.bluetooth import inject_bluetooth_service_info
async def test_sensors(hass: HomeAssistant, entity_registry_enabled_by_default) -> None: async def test_sensors(
hass: HomeAssistant, entity_registry_enabled_by_default: None
) -> None:
"""Test setting up creates the sensors.""" """Test setting up creates the sensors."""
await async_setup_component(hass, DOMAIN, {}) await async_setup_component(hass, DOMAIN, {})
inject_bluetooth_service_info(hass, WOHAND_SERVICE_INFO) inject_bluetooth_service_info(hass, WOHAND_SERVICE_INFO)

View file

@ -210,7 +210,7 @@ async def test_uptime_sensors(
hass: HomeAssistant, hass: HomeAssistant,
aioclient_mock: AiohttpClientMocker, aioclient_mock: AiohttpClientMocker,
mock_unifi_websocket, mock_unifi_websocket,
entity_registry_enabled_by_default, entity_registry_enabled_by_default: None,
initial_uptime, initial_uptime,
event_uptime, event_uptime,
new_uptime, new_uptime,
@ -296,7 +296,7 @@ async def test_remove_sensors(
hass: HomeAssistant, hass: HomeAssistant,
aioclient_mock: AiohttpClientMocker, aioclient_mock: AiohttpClientMocker,
mock_unifi_websocket, mock_unifi_websocket,
entity_registry_enabled_by_default, entity_registry_enabled_by_default: None,
) -> None: ) -> None:
"""Verify removing of clients work as expected.""" """Verify removing of clients work as expected."""
wired_client = { wired_client = {

View file

@ -1,9 +1,8 @@
"""Test the UniFi Protect sensor platform.""" """Test the UniFi Protect sensor platform."""
from __future__ import annotations from __future__ import annotations
from datetime import datetime, timedelta from datetime import datetime, timedelta
from unittest.mock import AsyncMock, Mock from unittest.mock import Mock
from pyunifiprotect.data import ( from pyunifiprotect.data import (
NVR, NVR,
@ -398,7 +397,7 @@ async def test_sensor_setup_camera(
async def test_sensor_setup_camera_with_last_trip_time( async def test_sensor_setup_camera_with_last_trip_time(
hass: HomeAssistant, hass: HomeAssistant,
entity_registry_enabled_by_default: AsyncMock, entity_registry_enabled_by_default: None,
ufp: MockUFPFixture, ufp: MockUFPFixture,
doorbell: Camera, doorbell: Camera,
fixed_now: datetime, fixed_now: datetime,
@ -474,7 +473,7 @@ async def test_sensor_update_alarm(
async def test_sensor_update_alarm_with_last_trip_time( async def test_sensor_update_alarm_with_last_trip_time(
hass: HomeAssistant, hass: HomeAssistant,
entity_registry_enabled_by_default: AsyncMock, entity_registry_enabled_by_default: None,
ufp: MockUFPFixture, ufp: MockUFPFixture,
sensor_all: Sensor, sensor_all: Sensor,
fixed_now: datetime, fixed_now: datetime,