Fix remaining pre-existing ty diagnostics in test files

Completes the isinstance/cast narrowing + Optional-field assert pattern
across the last batch of test files. custom_components and tests are
now both fully clean under ruff check, ruff format --check, and ty check.
This commit is contained in:
Marc Billow committed 2026-08-03 00:14:58 +00:00
1 parent 36a642135b
commit 679c3d2bce
5 files changed
+41 -12

No files matched your search

+3 -1
View File
@@ -75,7 +75,9 @@ def test_course_bound_to_shared_course_vs_0():
the shipped dryer_cycle_table_03 translations, consistent with
washer/dishwasher."""
assert dryer.DRYER_COURSE.href == "/course/vs/0"
desc = next(e for e in dryer.DRYER_COURSE.entities if e.key == "cycle" and isinstance(e, SelectDesc))
desc = next(
e for e in dryer.DRYER_COURSE.entities if e.key == "cycle" and isinstance(e, SelectDesc)
)
assert callable(desc.translation_key)
table_03 = {"/st/dryercourse/vs/0": {"x.com.samsung.da.st.courseTable": "Table_03"}}
assert desc.translation_key(table_03) == "dryer_cycle_table_03"