Browse Source

Beca BHT002: remove device tests

There is nothing unique about this device, the generic device config
tests are adequate to cover it.

Preparation for changes in PR #2640 that will break the tests due to
unknown attribute renaming and moving to another entity it is related
to, also the duplicate floor_temperature in the climate entity removed
since it has it's own entity (which was maybe not originally supported
when this early device config was originally added, then it was left
temporarily for compatibility).
Jason Rumney 1 năm trước cách đây
mục cha
commit
5d0f38d679

+ 0 - 126
tests/devices/test_beca_bht002_thermostat.py

@@ -1,126 +0,0 @@
-from homeassistant.components.climate.const import (
-    PRESET_COMFORT,
-    PRESET_ECO,
-    ClimateEntityFeature,
-    HVACMode,
-)
-from homeassistant.components.sensor import SensorDeviceClass
-from homeassistant.const import UnitOfTemperature
-
-from ..const import BECA_BHT002_PAYLOAD
-from ..helpers import assert_device_properties_set
-from ..mixins.climate import TargetTemperatureTests
-from ..mixins.lock import BasicLockTests
-from ..mixins.sensor import BasicSensorTests
-from .base_device_tests import TuyaDeviceTestCase
-
-POWER_DPS = "1"
-TEMPERATURE_DPS = "2"
-CURRENTTEMP_DPS = "3"
-HVACMODE_DPS = "4"
-PRESET_DPS = "5"
-LOCK_DPS = "6"
-FLOOR_DPS = "102"
-UNKNOWN104_DPS = "104"
-
-
-class TestBecaBHT002Thermostat(
-    BasicLockTests,
-    BasicSensorTests,
-    TargetTemperatureTests,
-    TuyaDeviceTestCase,
-):
-    __test__ = True
-
-    def setUp(self):
-        self.setUpForConfig(
-            "beca_bht002_thermostat_c.yaml",
-            BECA_BHT002_PAYLOAD,
-        )
-        self.subject = self.entities.get("climate")
-        self.setUpTargetTemperature(
-            TEMPERATURE_DPS,
-            self.subject,
-            min=5.0,
-            max=35.0,
-            scale=2,
-        )
-        self.setUpBasicLock(LOCK_DPS, self.entities.get("lock_child_lock"))
-        self.setUpBasicSensor(
-            FLOOR_DPS,
-            self.entities.get("sensor_external_temperature"),
-            unit=UnitOfTemperature.CELSIUS,
-            device_class=SensorDeviceClass.TEMPERATURE,
-            state_class="measurement",
-            testdata=(30, 15),
-        )
-        self.mark_secondary(["lock_child_lock"])
-
-    def test_supported_features(self):
-        self.assertEqual(
-            self.subject.supported_features,
-            (
-                ClimateEntityFeature.PRESET_MODE
-                | ClimateEntityFeature.TARGET_TEMPERATURE
-                | ClimateEntityFeature.TURN_OFF
-                | ClimateEntityFeature.TURN_ON
-            ),
-        )
-
-    def test_temperature_unit(self):
-        self.assertEqual(
-            self.subject.temperature_unit,
-            UnitOfTemperature.CELSIUS,
-        )
-
-    async def test_legacy_set_temperature_with_preset_mode(self):
-        async with assert_device_properties_set(
-            self.subject._device, {PRESET_DPS: True}
-        ):
-            await self.subject.async_set_temperature(preset_mode=PRESET_ECO)
-
-    async def test_legacy_set_temperature_with_both_properties(self):
-        async with assert_device_properties_set(
-            self.subject._device,
-            {
-                TEMPERATURE_DPS: 44,
-                PRESET_DPS: False,
-            },
-        ):
-            await self.subject.async_set_temperature(
-                temperature=22, preset_mode=PRESET_COMFORT
-            )
-
-    def test_current_temperature(self):
-        self.dps[CURRENTTEMP_DPS] = 44
-        self.assertEqual(self.subject.current_temperature, 22)
-
-    def test_hvac_mode(self):
-        self.dps[POWER_DPS] = False
-        self.dps[HVACMODE_DPS] = "0"
-        self.assertEqual(self.subject.hvac_mode, HVACMode.OFF)
-
-        self.dps[POWER_DPS] = True
-        self.assertEqual(self.subject.hvac_mode, HVACMode.AUTO)
-
-        self.dps[HVACMODE_DPS] = "1"
-        self.assertEqual(self.subject.hvac_mode, HVACMode.HEAT)
-
-    def test_hvac_modes(self):
-        self.assertCountEqual(
-            self.subject.hvac_modes,
-            [
-                HVACMode.HEAT,
-                HVACMode.AUTO,
-                HVACMode.OFF,
-            ],
-        )
-
-    def test_extra_state_attributes(self):
-        self.dps[FLOOR_DPS] = 45
-        self.dps[UNKNOWN104_DPS] = False
-
-        self.assertDictEqual(
-            self.subject.extra_state_attributes,
-            {"floor_temperature": 22.5, "unknown_104": False},
-        )