Skip to content

Commit d4a8924

Browse files
committed
test: set queue timeout of 10
1 parent 14f03c7 commit d4a8924

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

tests/conftest.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
# Used by fixtures to handle incoming requests and prepare responses
2424
RequestHandler = Callable[[bytes], bytes | None]
25+
QUEUE_TIMEOUT = 10
2526

2627

2728
class FakeSocketHandler:
@@ -145,7 +146,7 @@ def mqtt_client(mock_create_connection: None, mock_select: None) -> Generator[Ro
145146
device=home_data.devices[0],
146147
model=home_data.products[0].model,
147148
)
148-
client = RoborockMqttClientV1(user_data, device_info)
149+
client = RoborockMqttClientV1(user_data, device_info, queue_timeout=QUEUE_TIMEOUT)
149150
yield client
150151
# Clean up any resources after the test
151152

@@ -233,4 +234,4 @@ def local_client_fixture(mock_create_local_connection: None) -> Generator[Roboro
233234
model=home_data.products[0].model,
234235
host=TEST_LOCAL_API_HOST,
235236
)
236-
yield RoborockLocalClientV1(device_info)
237+
yield RoborockLocalClientV1(device_info, queue_timeout=QUEUE_TIMEOUT)

tests/test_a01_api.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
)
3434

3535
from . import mqtt_packet
36+
from .conftest import QUEUE_TIMEOUT
3637

3738

3839
@pytest.fixture(name="a01_mqtt_client")
@@ -49,7 +50,7 @@ async def a01_mqtt_client_fixture(mock_create_connection: None, mock_select: Non
4950
device=home_data.devices[0],
5051
model=home_data.products[0].model,
5152
)
52-
return RoborockMqttClientA01(user_data, device_info, RoborockCategory.WASHING_MACHINE)
53+
return RoborockMqttClientA01(user_data, device_info, RoborockCategory.WASHING_MACHINE, queue_timeout=QUEUE_TIMEOUT)
5354

5455

5556
@pytest.fixture(name="connected_a01_mqtt_client")

tests/test_api.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
)
3333

3434
from . import mqtt_packet
35+
from .conftest import QUEUE_TIMEOUT
3536

3637

3738
def test_can_create_prepared_request():

0 commit comments

Comments
 (0)