Skip to content

Commit 5c1800c

Browse files
committed
fix tests
1 parent c2eb1e8 commit 5c1800c

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

tests/devices/traits/v1/fixtures.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ def web_api_client_fixture() -> AsyncMock:
4646
return AsyncMock()
4747

4848

49-
@pytest.fixture(name="home_data")
50-
def home_data_fixture(request: pytest.FixtureRequest) -> HomeData:
49+
@pytest.fixture(name="trait_home_data")
50+
def trait_home_data_fixture(request: pytest.FixtureRequest) -> HomeData:
5151
"""Fixture to provide HomeData, optionally overridden via indirect parametrization."""
5252
return deepcopy(getattr(request, "param", HOME_DATA))
5353

@@ -59,15 +59,15 @@ def roborock_cache_fixture() -> Cache:
5959

6060

6161
@pytest.fixture(autouse=True, name="device_cache")
62-
def device_cache_fixture(roborock_cache: Cache, home_data: HomeData) -> DeviceCache:
62+
def device_cache_fixture(roborock_cache: Cache, trait_home_data: HomeData) -> DeviceCache:
6363
"""Fixture to provide a DeviceCache instance for tests."""
64-
return DeviceCache(home_data.get_all_devices()[0].duid, roborock_cache)
64+
return DeviceCache(trait_home_data.get_all_devices()[0].duid, roborock_cache)
6565

6666

6767
@pytest.fixture(name="device_info")
68-
def device_info_fixture(home_data: HomeData) -> HomeDataDevice:
68+
def device_info_fixture(trait_home_data: HomeData) -> HomeDataDevice:
6969
"""Fixture to provide a DeviceInfo instance for tests."""
70-
return home_data.get_all_devices()[0]
70+
return trait_home_data.get_all_devices()[0]
7171

7272

7373
@pytest.fixture(name="products")
@@ -85,7 +85,7 @@ def device_fixture(
8585
web_api_client: AsyncMock,
8686
device_cache: DeviceCache,
8787
device_info: HomeDataDevice,
88-
home_data: HomeData,
88+
trait_home_data: HomeData,
8989
products: list[HomeDataProduct],
9090
) -> RoborockDevice:
9191
"""Fixture to set up the device for tests."""
@@ -97,7 +97,7 @@ def device_fixture(
9797
trait=v1.create(
9898
device_info.duid,
9999
product,
100-
home_data,
100+
trait_home_data,
101101
mock_rpc_channel,
102102
mock_mqtt_rpc_channel,
103103
mock_map_rpc_channel,

tests/devices/traits/v1/test_rooms.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,15 +209,15 @@ def _build_shared_home_data() -> HomeData:
209209
return home_data
210210

211211

212-
@pytest.mark.parametrize("home_data", [_build_shared_home_data()], indirect=True)
212+
@pytest.mark.parametrize("trait_home_data", [_build_shared_home_data()], indirect=True)
213213
async def test_refresh_shared_room_names_use_shared_device_rooms(
214214
rooms_trait: RoomsTrait,
215-
home_data: HomeData,
215+
trait_home_data: HomeData,
216216
web_api_client: AsyncMock,
217217
mock_rpc_channel: AsyncMock,
218218
) -> None:
219219
"""Test shared devices resolve room names via the shared-device room list."""
220-
assert home_data.received_devices
220+
assert trait_home_data.received_devices
221221
assert not rooms_trait.rooms
222222

223223
web_api_client.get_shared_device_rooms.return_value = [

0 commit comments

Comments
 (0)