mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 02:49:40 +00:00
Enable Ruff rule PT007 (#113764)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
@@ -337,7 +337,7 @@ def test_get_unit_system_invalid(key: str) -> None:
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("device_class", "original_unit", "state_unit"),
|
||||
(
|
||||
[
|
||||
# Test atmospheric pressure
|
||||
(
|
||||
SensorDeviceClass.ATMOSPHERIC_PRESSURE,
|
||||
@@ -477,7 +477,7 @@ def test_get_unit_system_invalid(key: str) -> None:
|
||||
UnitOfSpeed.KILOMETERS_PER_HOUR,
|
||||
),
|
||||
(SensorDeviceClass.WIND_SPEED, "very_fast", None),
|
||||
),
|
||||
],
|
||||
)
|
||||
def test_get_metric_converted_unit_(
|
||||
device_class: SensorDeviceClass,
|
||||
@@ -537,7 +537,7 @@ UNCONVERTED_UNITS_METRIC_SYSTEM = {
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"device_class",
|
||||
(
|
||||
[
|
||||
SensorDeviceClass.ATMOSPHERIC_PRESSURE,
|
||||
SensorDeviceClass.DISTANCE,
|
||||
SensorDeviceClass.GAS,
|
||||
@@ -547,7 +547,7 @@ UNCONVERTED_UNITS_METRIC_SYSTEM = {
|
||||
SensorDeviceClass.SPEED,
|
||||
SensorDeviceClass.VOLUME,
|
||||
SensorDeviceClass.WATER,
|
||||
),
|
||||
],
|
||||
)
|
||||
def test_metric_converted_units(device_class: SensorDeviceClass) -> None:
|
||||
"""Test unit conversion rules are in place for all units."""
|
||||
@@ -565,7 +565,7 @@ def test_metric_converted_units(device_class: SensorDeviceClass) -> None:
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("device_class", "original_unit", "state_unit"),
|
||||
(
|
||||
[
|
||||
# Test atmospheric pressure
|
||||
(
|
||||
SensorDeviceClass.ATMOSPHERIC_PRESSURE,
|
||||
@@ -697,7 +697,7 @@ def test_metric_converted_units(device_class: SensorDeviceClass) -> None:
|
||||
(SensorDeviceClass.WIND_SPEED, UnitOfSpeed.KNOTS, None),
|
||||
(SensorDeviceClass.WIND_SPEED, UnitOfSpeed.MILES_PER_HOUR, None),
|
||||
(SensorDeviceClass.WIND_SPEED, "very_fast", None),
|
||||
),
|
||||
],
|
||||
)
|
||||
def test_get_us_converted_unit(
|
||||
device_class: SensorDeviceClass,
|
||||
@@ -748,7 +748,7 @@ UNCONVERTED_UNITS_US_SYSTEM = {
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"device_class",
|
||||
(
|
||||
[
|
||||
SensorDeviceClass.ATMOSPHERIC_PRESSURE,
|
||||
SensorDeviceClass.DISTANCE,
|
||||
SensorDeviceClass.GAS,
|
||||
@@ -758,7 +758,7 @@ UNCONVERTED_UNITS_US_SYSTEM = {
|
||||
SensorDeviceClass.SPEED,
|
||||
SensorDeviceClass.VOLUME,
|
||||
SensorDeviceClass.WATER,
|
||||
),
|
||||
],
|
||||
)
|
||||
def test_imperial_converted_units(device_class: SensorDeviceClass) -> None:
|
||||
"""Test unit conversion rules are in place for all units."""
|
||||
|
||||
Reference in New Issue
Block a user