2929TEST_SECURITY_DATA = SecurityData (endpoint = "test_endpoint" , nonce = b"test_nonce_16byte" )
3030TEST_HOST = "1.1.1.1"
3131
32+
3233@dataclass
3334class FakeResponse (RoborockBase ):
3435 state : str
@@ -330,22 +331,22 @@ async def test_v1_channel_subscription_receives_mqtt_messages(
330331) -> None :
331332 """Test that subscribed callback receives MQTT messages."""
332333 callback = Mock ()
333-
334+
334335 # Setup MQTT subscription to capture the internal callback
335336 mock_mqtt_channel .subscribe .return_value = Mock ()
336337 mock_local_channel .connect .side_effect = RoborockException ("Local failed" )
337-
338+
338339 # Subscribe
339340 with patch .object (v1_channel , "_get_networking_info" , return_value = TEST_NETWORKING_INFO ):
340341 await v1_channel .subscribe (callback )
341-
342+
342343 # Get the MQTT callback that was registered
343344 mqtt_callback = mock_mqtt_channel .subscribe .call_args [0 ][0 ]
344-
345+
345346 # Simulate MQTT message
346347 test_message = TEST_RESPONSE
347348 mqtt_callback (test_message )
348-
349+
349350 # Verify user callback was called
350351 callback .assert_called_once_with (test_message )
351352
@@ -357,22 +358,22 @@ async def test_v1_channel_subscription_receives_local_messages(
357358) -> None :
358359 """Test that subscribed callback receives local messages."""
359360 callback = Mock ()
360-
361+
361362 # Setup both connections
362363 mock_mqtt_channel .subscribe .return_value = Mock ()
363364 mock_local_channel .subscribe .return_value = Mock ()
364-
365+
365366 # Subscribe
366367 with patch .object (v1_channel , "_get_networking_info" , return_value = TEST_NETWORKING_INFO ):
367368 await v1_channel .subscribe (callback )
368-
369+
369370 # Get the local callback that was registered
370371 local_callback = mock_local_channel .subscribe .call_args [0 ][0 ]
371-
372+
372373 # Simulate local message
373374 test_message = TEST_RESPONSE
374375 local_callback (test_message )
375-
376+
376377 # Verify user callback was called
377378 callback .assert_called_once_with (test_message )
378379
@@ -401,10 +402,10 @@ async def test_v1_channel_networking_info_retrieved_during_connection(
401402 # Verify both connections are established
402403 assert v1_channel .is_mqtt_connected
403404 assert v1_channel .is_local_connected
404-
405+
405406 # Verify network info was requested via MQTT
406407 mock_mqtt_channel .send_command .assert_called_once ()
407-
408+
408409 # Verify local session was created with the correct IP
409410 mock_local_session .assert_called_once_with (mock_data .NETWORK_INFO ["ip" ])
410411
0 commit comments