Skip to content

Commit b2773b9

Browse files
committed
test: set queue timeout of 10
1 parent 6e29e74 commit b2773b9

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 @@ async def mqtt_client(mock_create_connection: None, mock_select: None) -> AsyncG
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
try:
150151
yield client
151152
finally:
@@ -239,7 +240,7 @@ async def local_client_fixture(mock_create_local_connection: None) -> AsyncGener
239240
model=home_data.products[0].model,
240241
host=TEST_LOCAL_API_HOST,
241242
)
242-
client = RoborockLocalClientV1(device_info)
243+
yield RoborockLocalClientV1(device_info, queue_timeout=QUEUE_TIMEOUT)
243244
try:
244245
yield client
245246
finally:

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")
@@ -51,7 +52,7 @@ async def a01_mqtt_client_fixture(
5152
device=home_data.devices[0],
5253
model=home_data.products[0].model,
5354
)
54-
client = RoborockMqttClientA01(user_data, device_info, RoborockCategory.WASHING_MACHINE)
55+
client = RoborockMqttClientA01(user_data, device_info, RoborockCategory.WASHING_MACHINE, queue_timeout=QUEUE_TIMEOUT)
5556
try:
5657
yield client
5758
finally:

tests/test_api.py

Lines changed: 1 addition & 0 deletions
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
def test_can_create_prepared_request():

0 commit comments

Comments
 (0)