tests: add type annotations to IoT tests (#1685)

Add type annotations to all test functions across 8 files in `tests/iot/`, improving type safety and enabling mypy to check function bodies.
This commit is contained in:
ZeliardM
2026-07-05 12:31:48 -04:00
committed by GitHub
parent bb27a43027
commit da2588291d
15 changed files with 151 additions and 126 deletions

View File

@@ -1,11 +1,15 @@
from unittest.mock import AsyncMock
from pytest_mock import MockerFixture
from kasa import Module
from kasa.iot import IotStrip
from kasa.iot.iotstrip import IotStripPlug
from tests.conftest import strip_emeter_iot, strip_iot
@strip_iot
async def test_strip_update_and_child_update_behaviors(dev):
async def test_strip_update_and_child_update_behaviors(dev: IotStrip) -> None:
await dev.update()
await dev.update(update_children=False)
@@ -18,9 +22,10 @@ async def test_strip_update_and_child_update_behaviors(dev):
@strip_iot
async def test_strip_child_delegated_properties(dev):
async def test_strip_child_delegated_properties(dev: IotStrip) -> None:
await dev.update()
child = dev.children[0]
assert isinstance(child, IotStripPlug)
assert child.led is False
assert child.time == dev.time
@@ -32,7 +37,7 @@ async def test_strip_child_delegated_properties(dev):
@strip_emeter_iot
async def test_strip_emeter_erase_stats(dev, mocker):
async def test_strip_emeter_erase_stats(dev: IotStrip, mocker: MockerFixture) -> None:
await dev.update()
for child in dev.children: