tests: apply ruff format to CO2 assertions
This commit is contained in:
1 parent
33a06b9ae8
commit
258cdc1647
2 files changed
+4
-7
No files matched your search
@@ -110,9 +110,9 @@ def test_co2_matches_air_monitor_mapping():
|
|||||||
assert desc.unit == "ppm"
|
assert desc.unit == "ppm"
|
||||||
assert desc.state_class == "measurement"
|
assert desc.state_class == "measurement"
|
||||||
assert desc.exists_fn is not None
|
assert desc.exists_fn is not None
|
||||||
assert desc.value_fn(
|
assert (
|
||||||
[{"x.com.samsung.da.type": "CO2", "x.com.samsung.da.value": ["498"]}]
|
desc.value_fn([{"x.com.samsung.da.type": "CO2", "x.com.samsung.da.value": ["498"]}]) == 498
|
||||||
) == 498
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_every_air_quality_sensor_still_reads_a_plain_int():
|
def test_every_air_quality_sensor_still_reads_a_plain_int():
|
||||||
|
|||||||
@@ -92,10 +92,7 @@ def test_co2_reads_when_the_items_list_includes_the_type():
|
|||||||
desc = next(e for e in air_purifier.AIR_QUALITY.entities if e.key == "co2")
|
desc = next(e for e in air_purifier.AIR_QUALITY.entities if e.key == "co2")
|
||||||
assert desc.exists_fn({"x.com.samsung.da.items": []}, {}) is False
|
assert desc.exists_fn({"x.com.samsung.da.items": []}, {}) is False
|
||||||
assert (
|
assert (
|
||||||
desc.exists_fn(
|
desc.exists_fn({"x.com.samsung.da.items": [{"x.com.samsung.da.type": "CO2"}]}, {}) is True
|
||||||
{"x.com.samsung.da.items": [{"x.com.samsung.da.type": "CO2"}]}, {}
|
|
||||||
)
|
|
||||||
is True
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user