mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-04 09:44:14 +00:00
Move tests folder to top level of project (#1242)
This commit is contained in:
29
tests/smart/modules/test_humidity.py
Normal file
29
tests/smart/modules/test_humidity.py
Normal file
@@ -0,0 +1,29 @@
|
||||
import pytest
|
||||
|
||||
from kasa.smart.modules import HumiditySensor
|
||||
|
||||
from ...device_fixtures import parametrize
|
||||
|
||||
humidity = parametrize(
|
||||
"has humidity", component_filter="humidity", protocol_filter={"SMART.CHILD"}
|
||||
)
|
||||
|
||||
|
||||
@humidity
|
||||
@pytest.mark.parametrize(
|
||||
("feature", "type"),
|
||||
[
|
||||
("humidity", int),
|
||||
("humidity_warning", bool),
|
||||
],
|
||||
)
|
||||
async def test_humidity_features(dev, feature, type):
|
||||
"""Test that features are registered and work as expected."""
|
||||
humidity: HumiditySensor = dev.modules["HumiditySensor"]
|
||||
|
||||
prop = getattr(humidity, feature)
|
||||
assert isinstance(prop, type)
|
||||
|
||||
feat = dev.features[feature]
|
||||
assert feat.value == prop
|
||||
assert isinstance(feat.value, type)
|
Reference in New Issue
Block a user