From 863fe32526d341c27b1d6cf9133b23f49ca7aaf9 Mon Sep 17 00:00:00 2001 From: galaxysj Date: Mon, 10 Aug 2026 15:19:13 +0900 Subject: [PATCH] Cover reported washer course table --- tests/test_laundry_capabilities.py | 39 ++++++++++++++++++++++++++++++ tests/test_translations.py | 32 ++++++++++++++++++++++++ 2 files changed, 71 insertions(+) diff --git a/tests/test_laundry_capabilities.py b/tests/test_laundry_capabilities.py index 5590e30..740fddd 100644 --- a/tests/test_laundry_capabilities.py +++ b/tests/test_laundry_capabilities.py @@ -54,6 +54,45 @@ class TestCourseHelpers: assert laundry.cycle_options({}) == [] assert laundry.cycle_options({"/wm/editcourse/vs/0": {}}) == [] + def test_decodes_reported_washer_course_table_including_personal_slots(self): + """Real DA_WM_TP1_21_COMMON diagnostics, with every selectable + standard and personal-course code preserved in the device's order. + F1/F3 are part of the packed list; their labels come from the + companion personal-course resource tested below. + """ + resources = { + "/wm/editcourse/vs/0": { + "x.com.samsung.da.editCourseList": ( + "EditCourseList_696F73757801719688706D6A76726C6E6B777479F1F3" + ), + }, + } + + assert laundry.cycle_options(resources) == [ + "69", + "6F", + "73", + "75", + "78", + "01", + "71", + "96", + "88", + "70", + "6D", + "6A", + "76", + "72", + "6C", + "6E", + "6B", + "77", + "74", + "79", + "F1", + "F3", + ] + def test_option_value(self): opts = ["DeviceType_0167", "Course_1C", "GMT_04"] assert laundry.option_value(opts, "Course") == "1C" diff --git a/tests/test_translations.py b/tests/test_translations.py index 9309a01..2c9b7cd 100644 --- a/tests/test_translations.py +++ b/tests/test_translations.py @@ -190,6 +190,38 @@ def test_confirmed_washer_table_02_missing_course_names(): } +def test_reported_washer_standard_courses_all_have_table_02_labels(): + """Every non-personal code in the reported washer's live course list + must resolve through the Table_02 catalog instead of appearing as raw + text. F1/F3 deliberately come from device-provided personal names. + """ + states = _load("en")["entity"]["select"]["washer_cycle_table_02"]["state"] + reported = { + "69", + "6f", + "73", + "75", + "78", + "01", + "71", + "96", + "88", + "70", + "6d", + "6a", + "76", + "72", + "6c", + "6e", + "6b", + "77", + "74", + "79", + } + + assert reported <= states.keys() + + def test_confirmed_dishwasher_course_names(): states = _load("en")["entity"]["select"]["dishwasher_cycle"]["state"] assert {