@@ -154,13 +154,20 @@ def analyze(
154154 # 测试 wait_freezes API(参数校验:time 和 wait_freezes_param.time 同时为零应返回 false)
155155 from maa .pipeline import JWaitFreezes
156156
157- wait_result = new_ctx .wait_freezes (
158- time = 0 , wait_freezes_param = JWaitFreezes (time = 0 )
159- )
160- print (f" wait_freezes (both zero): { wait_result } " )
161- assert (
162- not wait_result
163- ), "wait_freezes should return false when both time are zero"
157+ wait_cases = [
158+ ("both zero" , None ),
159+ ("both zero, with box" , (10 , 10 , 100 , 100 )),
160+ ]
161+ for case_name , box in wait_cases :
162+ wait_result = new_ctx .wait_freezes (
163+ time = 0 ,
164+ box = box ,
165+ wait_freezes_param = JWaitFreezes (time = 0 ),
166+ )
167+ print (f" wait_freezes ({ case_name } ): { wait_result } " )
168+ assert (
169+ not wait_result
170+ ), "wait_freezes should return false when both time are zero"
164171
165172 # 测试 override_image
166173 test_image = numpy .zeros ((100 , 100 , 3 ), dtype = numpy .uint8 )
@@ -218,7 +225,9 @@ def run(
218225 uuid = controller .uuid
219226 resolution = controller .resolution
220227 info = controller .info
221- print (f" connected: { connected } , uuid: { uuid } , resolution: { resolution } , info type: { info .get ('type' )} " )
228+ print (
229+ f" connected: { connected } , uuid: { uuid } , resolution: { resolution } , info type: { info .get ('type' )} "
230+ )
222231
223232 global runned
224233 runned = True
@@ -398,7 +407,9 @@ def test_controller_api():
398407 print (f" info: { info } " )
399408 assert isinstance (info , dict ), "info should be a dict"
400409 assert "type" in info , "info should contain 'type'"
401- assert info ["type" ].startswith ("dbg_" ), "dbg controller type should start with 'dbg_'"
410+ assert info ["type" ].startswith (
411+ "dbg_"
412+ ), "dbg controller type should start with 'dbg_'"
402413
403414 # 测试输入操作
404415 dbg_controller .post_click (100 , 100 ).wait ()
@@ -685,7 +696,9 @@ def test_custom_controller():
685696 print (f" info: { info } " )
686697 assert isinstance (info , dict ), "info should be a dict"
687698 assert info .get ("type" ) == "custom" , "info type should be custom"
688- assert info .get ("custom_key" ) == "custom_value" , "custom info should contain custom_key"
699+ assert (
700+ info .get ("custom_key" ) == "custom_value"
701+ ), "custom info should contain custom_key"
689702 assert info .get ("answer" ) == 42 , "custom info should contain answer"
690703
691704 ret &= controller .post_start_app ("custom_aaa" ).wait ().succeeded
0 commit comments