Skip to content

Commit 93072e2

Browse files
committed
test(YXCleanType): add tests for readable public values and compatibility with aliases
1 parent de68ff2 commit 93072e2

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

tests/data/test_code_mappings.py

Lines changed: 23 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:
@@ -89,3 +89,25 @@ def test_homedata_product_unknown_category():
8989
product = HomeDataProduct.from_dict(data)
9090
assert product.id == "unknown_cat_id"
9191
assert product.category == RoborockCategory.UNKNOWN
92+
93+
94+
def test_yx_clean_type_legacy_values_stable() -> None:
95+
"""Test YXCleanType exposes readable public values."""
96+
assert YXCleanType.VAC_AND_MOP.value == "vac_and_mop"
97+
assert YXCleanType.VACUUM.value == "vacuum"
98+
assert YXCleanType.MOP.value == "mop"
99+
100+
101+
@pytest.mark.parametrize(
102+
("input_value", "expected"),
103+
[
104+
("vac_and_mop", YXCleanType.VAC_AND_MOP),
105+
("vacuum", YXCleanType.VACUUM),
106+
("mop", YXCleanType.MOP),
107+
],
108+
)
109+
def test_yx_clean_type_from_value_compat_aliases(
110+
input_value: str, expected: YXCleanType
111+
) -> None:
112+
"""Test YXCleanType accepts readable values."""
113+
assert YXCleanType.from_value(input_value) is expected

0 commit comments

Comments
 (0)