Skip to content

Commit ac6d53a

Browse files
committed
Use asyncio mode in tests
1 parent 3913e01 commit ac6d53a

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

tests/test_api.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,12 @@ def test_can_create_prepared_request():
2424
PreparedRequest("https://sample.com")
2525

2626

27-
def test_can_create_mqtt_roborock():
27+
async def test_can_create_mqtt_roborock():
2828
home_data = HomeData.from_dict(HOME_DATA_RAW)
2929
device_info = DeviceData(device=home_data.devices[0], model=home_data.products[0].model)
3030
RoborockMqttClientV1(UserData.from_dict(USER_DATA), device_info)
3131

3232

33-
@pytest.mark.asyncio
3433
async def test_sync_connect(mqtt_client):
3534
with patch("paho.mqtt.client.Client.connect", return_value=mqtt.MQTT_ERR_SUCCESS):
3635
with patch("paho.mqtt.client.Client.loop_start", return_value=mqtt.MQTT_ERR_SUCCESS):
@@ -41,7 +40,6 @@ async def test_sync_connect(mqtt_client):
4140
connected_future.cancel()
4241

4342

44-
@pytest.mark.asyncio
4543
async def test_get_base_url_no_url():
4644
rc = RoborockApiClient("sample@gmail.com")
4745
with patch("roborock.web_api.PreparedRequest.request") as mock_request:
@@ -50,7 +48,6 @@ async def test_get_base_url_no_url():
5048
assert rc.base_url == "https://sample.com"
5149

5250

53-
@pytest.mark.asyncio
5451
async def test_request_code():
5552
rc = RoborockApiClient("sample@gmail.com")
5653
with patch("roborock.web_api.RoborockApiClient._get_base_url"), patch(
@@ -60,7 +57,6 @@ async def test_request_code():
6057
await rc.request_code()
6158

6259

63-
@pytest.mark.asyncio
6460
async def test_get_home_data():
6561
rc = RoborockApiClient("sample@gmail.com")
6662
with patch("roborock.web_api.RoborockApiClient._get_base_url"), patch(
@@ -77,7 +73,6 @@ async def test_get_home_data():
7773
assert result == HomeData.from_dict(HOME_DATA_RAW)
7874

7975

80-
@pytest.mark.asyncio
8176
async def test_get_dust_collection_mode():
8277
home_data = HomeData.from_dict(HOME_DATA_RAW)
8378
device_info = DeviceData(device=home_data.devices[0], model=home_data.products[0].model)
@@ -89,7 +84,6 @@ async def test_get_dust_collection_mode():
8984
assert dust.mode == RoborockDockDustCollectionModeCode.light
9085

9186

92-
@pytest.mark.asyncio
9387
async def test_get_mop_wash_mode():
9488
home_data = HomeData.from_dict(HOME_DATA_RAW)
9589
device_info = DeviceData(device=home_data.devices[0], model=home_data.products[0].model)
@@ -102,7 +96,6 @@ async def test_get_mop_wash_mode():
10296
assert mop_wash.wash_interval == 1500
10397

10498

105-
@pytest.mark.asyncio
10699
async def test_get_washing_mode():
107100
home_data = HomeData.from_dict(HOME_DATA_RAW)
108101
device_info = DeviceData(device=home_data.devices[0], model=home_data.products[0].model)
@@ -115,7 +108,6 @@ async def test_get_washing_mode():
115108
assert washing_mode.wash_mode == 2
116109

117110

118-
@pytest.mark.asyncio
119111
async def test_get_prop():
120112
home_data = HomeData.from_dict(HOME_DATA_RAW)
121113
device_info = DeviceData(device=home_data.devices[0], model=home_data.products[0].model)

0 commit comments

Comments
 (0)