1+ from __future__ import annotations
2+
13from typing import Any
24
35import pytest
46
57from deebot_client .commands .json import (
68 GetWashInfo ,
79)
10+ from deebot_client .commands .json .wash_info import SetWashInfo
811from deebot_client .events import WashInfoEvent , WashMode
912from tests .helpers import (
1013 get_request_json ,
1114 get_success_body ,
1215 verify_DisplayNameEnum_unique ,
1316)
1417
15- from . import assert_command
18+ from . import assert_command , assert_set_command
1619
1720
1821def test_WashInfo_unique () -> None :
@@ -35,3 +38,22 @@ def test_WashInfo_unique() -> None:
3538async def test_GetWashInfo (json : dict [str , Any ], expected : WashInfoEvent ) -> None :
3639 json = get_request_json (get_success_body (json ))
3740 await assert_command (GetWashInfo (), json , expected )
41+
42+
43+ @pytest .mark .parametrize (("value" ), [WashMode .HOT , "hot" ])
44+ async def test_SetWashInfo_mode (value : WashMode | str ) -> None :
45+ command = SetWashInfo (mode = value )
46+ args = {"mode" : WashMode .HOT }
47+ await assert_set_command (command , args , WashInfoEvent (WashMode .HOT , None , None ))
48+
49+
50+ def test_SetWashInfo_mode_inexisting_value () -> None :
51+ with pytest .raises (ValueError , match = "'INEXSTING' is not a valid WashMode member" ):
52+ SetWashInfo (mode = "inexsting" )
53+
54+
55+ @pytest .mark .parametrize (("value" ), [1 ])
56+ async def test_SetWashInfo_hot_wash_amount (value : int ) -> None :
57+ command = SetWashInfo (hot_wash_amount = value )
58+ args = {"hot_wash_amount" : value }
59+ await assert_set_command (command , args , WashInfoEvent (None , None , value ))
0 commit comments