Skip to content

Commit e667b42

Browse files
committed
fix(dyad): parametrize clean mode tests with F25 Ultra codes
1 parent dd01ae5 commit e667b42

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

‎tests/data/test_code_mappings.py‎

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,24 @@ def test_roborock_mode_enum_display_names_group_duplicate_protocol_codes() -> No
172172
assert "deep_plus_cn" not in CleanRoutes.keys()
173173

174174

175-
def test_dyad_clean_mode_codes(caplog: pytest.LogCaptureFixture) -> None:
175+
@pytest.mark.parametrize(
176+
"code, expected",
177+
[
178+
# Codes reported by an F25 Ultra when switching modes in the app.
179+
(1, DyadCleanMode.auto),
180+
(3, DyadCleanMode.dehydration), # "Sponge" on the F25 Ultra
181+
(5, DyadCleanMode.hot_water),
182+
(6, DyadCleanMode.steam),
183+
],
184+
)
185+
def test_dyad_clean_mode_codes(code: int, expected: DyadCleanMode, caplog: pytest.LogCaptureFixture) -> None:
176186
"""Dyad clean mode codes reported by devices decode without warnings."""
177187
completed_warnings.clear()
178188
with caplog.at_level(logging.WARNING):
179-
assert DyadCleanMode(5) == DyadCleanMode.hot_water
180-
assert DyadCleanMode(6) == DyadCleanMode.steam
189+
assert DyadCleanMode(code) == expected
181190
assert "Missing DyadCleanMode" not in caplog.text
182191

183-
# A genuinely unknown code falls back to 'unknown' instead of 'auto'.
192+
193+
def test_dyad_clean_mode_unknown_code() -> None:
194+
"""An unrecognized Dyad clean mode falls back to 'unknown' instead of 'auto'."""
184195
assert DyadCleanMode(99) == DyadCleanMode.unknown

0 commit comments

Comments
 (0)