Skip to content

Commit 7cceb1f

Browse files
committed
test(YXCleanType): add tests for legacy clean type string aliases
1 parent 17dd1a9 commit 7cceb1f

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

tests/data/test_code_mappings.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import pytest
66

77
from roborock import HomeDataProduct, RoborockCategory
8-
from roborock.data.b01_q10.b01_q10_code_mappings import B01_Q10_DP
8+
from roborock.data.b01_q10.b01_q10_code_mappings import B01_Q10_DP, YXCleanType
99

1010

1111
def test_from_code() -> None:
@@ -52,6 +52,22 @@ def test_invalid_from_value() -> None:
5252
B01_Q10_DP.from_value("invalid_value")
5353

5454

55+
@pytest.mark.parametrize(
56+
("raw_value", "expected"),
57+
[
58+
("bothwork", YXCleanType.VAC_AND_MOP),
59+
("onlysweep", YXCleanType.VACUUM),
60+
("onlymop", YXCleanType.MOP),
61+
("BothWork", YXCleanType.VAC_AND_MOP),
62+
("ONLYSWEEP", YXCleanType.VACUUM),
63+
("OnlyMop", YXCleanType.MOP),
64+
],
65+
)
66+
def test_yxcleantype_from_value_legacy_aliases(raw_value: str, expected: YXCleanType) -> None:
67+
"""Ensure legacy clean type strings resolve to canonical enum members."""
68+
assert YXCleanType.from_value(raw_value) is expected
69+
70+
5571
@pytest.mark.parametrize(
5672
"input, expected",
5773
[

0 commit comments

Comments
 (0)