Apply ruff format to code merged from PR #251/#275

PR #251 and PR #275 predate this repo's ruff-format adoption on those
files; running the formatter (single->double quotes, line wrapping,
trailing-comma cleanup) keeps the merged code consistent with the rest
of the codebase. No behavior change.
This commit is contained in:
Marc Billow committed 2026-08-08 21:24:02 +00:00
1 parent 68dee12eb4
commit 8ed3d1467f
10 files changed
+222 -136

No files matched your search

+138 -64
View File
@@ -115,90 +115,164 @@ def test_no_catalog_carries_unresolved_core_references():
def test_confirmed_korean_table_02_washer_course_names():
states = _load('en')['entity']['select']['washer_cycle_table_02']['state']
assert {code: states[code] for code in (
'69', '6a', '6b', '6c', '6d', '6e', '6f', '70', '71',
'72', '73', '74', '75', '76', '77', '78', '79', '88',
)} == {
'69': 'AI Wash',
'6a': 'Wool',
'6b': 'Denim',
'6c': 'Blouses',
'6d': 'Delicates',
'6e': 'Active Wear',
'6f': 'Bedding',
'70': 'Towels',
'71': 'Quick Wash',
'72': 'Shirts',
'73': 'Sanitize',
'74': 'Drum Clean',
'75': 'Outdoor',
'76': 'Baby Care',
'77': 'Cottons',
'78': 'Rinse + Spin',
'79': 'Spin Only',
'88': 'Pet Care',
states = _load("en")["entity"]["select"]["washer_cycle_table_02"]["state"]
assert {
code: states[code]
for code in (
"69",
"6a",
"6b",
"6c",
"6d",
"6e",
"6f",
"70",
"71",
"72",
"73",
"74",
"75",
"76",
"77",
"78",
"79",
"88",
)
} == {
"69": "AI Wash",
"6a": "Wool",
"6b": "Denim",
"6c": "Blouses",
"6d": "Delicates",
"6e": "Active Wear",
"6f": "Bedding",
"70": "Towels",
"71": "Quick Wash",
"72": "Shirts",
"73": "Sanitize",
"74": "Drum Clean",
"75": "Outdoor",
"76": "Baby Care",
"77": "Cottons",
"78": "Rinse + Spin",
"79": "Spin Only",
"88": "Pet Care",
}
def test_confirmed_dishwasher_course_names():
states = _load('en')['entity']['select']['dishwasher_cycle']['state']
assert {code: states[code] for code in (
'82', '8a', 'a7', 'a8', '8c', '88',
)} == {
'82': 'Auto',
'8a': 'Normal',
'a7': 'Heavy',
'a8': 'Express',
'8c': 'Extra Silence',
'88': 'Self Clean',
states = _load("en")["entity"]["select"]["dishwasher_cycle"]["state"]
assert {
code: states[code]
for code in (
"82",
"8a",
"a7",
"a8",
"8c",
"88",
)
} == {
"82": "Auto",
"8a": "Normal",
"a7": "Heavy",
"a8": "Express",
"8c": "Extra Silence",
"88": "Self Clean",
}
def test_confirmed_course_names_are_localized():
washer_codes = (
'69', '6a', '6b', '6c', '6d', '6e', '6f', '70', '71',
'72', '73', '74', '75', '76', '77', '78', '79', '88',
"69",
"6a",
"6b",
"6c",
"6d",
"6e",
"6f",
"70",
"71",
"72",
"73",
"74",
"75",
"76",
"77",
"78",
"79",
"88",
)
dishwasher_codes = ('82', '8a', 'a7', 'a8', '8c', '88')
dishwasher_codes = ("82", "8a", "a7", "a8", "8c", "88")
expected = {
'cs': {
'washer': (
'AI praní', 'Vlna', 'Džíny', 'Halenky', 'Jemné prádlo',
'Sportovní oblečení', 'Ložní prádlo', 'Ručníky',
'Rychlé praní', 'Košile', 'Dezinfekce', 'Čištění bubnu',
'Outdoor', 'Dětské potřeby', 'Bavlna',
'Máchání + odstřeďování', 'Pouze odstřeďování',
'Péče o domácí mazlíčky',
"cs": {
"washer": (
"AI praní",
"Vlna",
"Džíny",
"Halenky",
"Jemné prádlo",
"Sportovní oblečení",
"Ložní prádlo",
"Ručníky",
"Rychlé praní",
"Košile",
"Dezinfekce",
"Čištění bubnu",
"Outdoor",
"Dětské potřeby",
"Bavlna",
"Máchání + odstřeďování",
"Pouze odstřeďování",
"Péče o domácí mazlíčky",
),
'dishwasher': (
'Automatický', 'Normální', 'Intenzivní', 'Expresní',
'Extra tichý', 'Samočištění',
"dishwasher": (
"Automatický",
"Normální",
"Intenzivní",
"Expresní",
"Extra tichý",
"Samočištění",
),
},
'nl': {
'washer': (
'AI Wash', 'Wol', 'Spijkergoed', 'Blouses', 'Fijne was',
'Sportkleding', 'Beddengoed', 'Handdoeken', 'Snelle was',
'Overhemden', 'Hygiëne', 'Trommel reinigen', 'Outdoor',
'Babyverzorging', 'Katoen', 'Spoelen + centrifugeren',
'Alleen centrifugeren', 'Pet Care',
"nl": {
"washer": (
"AI Wash",
"Wol",
"Spijkergoed",
"Blouses",
"Fijne was",
"Sportkleding",
"Beddengoed",
"Handdoeken",
"Snelle was",
"Overhemden",
"Hygiëne",
"Trommel reinigen",
"Outdoor",
"Babyverzorging",
"Katoen",
"Spoelen + centrifugeren",
"Alleen centrifugeren",
"Pet Care",
),
'dishwasher': (
'Auto', 'Normaal', 'Intensief', 'Express', 'Extra stil',
'Zelfreiniging',
"dishwasher": (
"Auto",
"Normaal",
"Intensief",
"Express",
"Extra stil",
"Zelfreiniging",
),
},
}
for language, translations in expected.items():
catalog = _load(language)['entity']['select']
washer = catalog['washer_cycle_table_02']['state']
dishwasher = catalog['dishwasher_cycle']['state']
assert tuple(washer[code] for code in washer_codes) == translations['washer']
assert tuple(dishwasher[code] for code in dishwasher_codes) == (
translations['dishwasher']
)
catalog = _load(language)["entity"]["select"]
washer = catalog["washer_cycle_table_02"]["state"]
dishwasher = catalog["dishwasher_cycle"]["state"]
assert tuple(washer[code] for code in washer_codes) == translations["washer"]
assert tuple(dishwasher[code] for code in dishwasher_codes) == (translations["dishwasher"])
# The hood fan is its device's primary feature: fan.py sets _attr_name = None