Fix ty type-check failures in new test files

resolve()/for_device_by_model() return DeviceRegistry | None; four new
test files used reg.capabilities/reg.pattern_capabilities without
narrowing away None first. Add the same 'assert reg is not None' idiom
test_dehumidifier_tp1x_dhm01001_capabilities.py already uses.

Verified against a clean venv running the exact CI commands (ruff format
--check, ruff check, ty check, pytest) rather than trusting a stale local
venv that had picked up a mismatched python3.11/3.13 site-packages split.
This commit is contained in:
Marc Billow committed 2026-08-07 15:52:46 +00:00
1 parent e2dcc75ed5
commit 8551974719
4 files changed
+8

No files matched your search

@@ -44,6 +44,7 @@ def _resources():
def _bound():
resources = _resources()
reg = resolve(resources, device_types=_DEVICE_TYPES)
assert reg is not None
return discover(resources, reg.capabilities, reg.pattern_capabilities), resources
@@ -68,6 +69,7 @@ def test_board_token_resolves_to_airconditioner_registry():
def test_no_unbound_hrefs():
resources = _resources()
reg = resolve(resources, device_types=_DEVICE_TYPES)
assert reg is not None
unbound = []
discover(resources, reg.capabilities, reg.pattern_capabilities, log=unbound.append)
assert unbound == []