Skip to content

Commit ad89a0e

Browse files
committed
test: update home discovery test to verify refresh behavior and state consistency
1 parent 9188b2c commit ad89a0e

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

tests/devices/traits/v1/test_home.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,13 +367,25 @@ async def test_discover_home_no_maps(
367367
"""Test discovery when no maps are available."""
368368
# Setup mock to return empty maps list
369369
mock_mqtt_rpc_channel.send_command.side_effect = [
370-
[{"max_multi_map": 0, "max_bak_map": 0, "multi_map_count": 0, "map_info": []}]
370+
# Discover home
371+
[{"max_multi_map": 0, "max_bak_map": 0, "multi_map_count": 0, "map_info": []}],
372+
# Refresh
373+
[{"max_multi_map": 0, "max_bak_map": 0, "multi_map_count": 0, "map_info": []}],
371374
]
372375

376+
# Discover home should not change anything
373377
await home_trait.discover_home()
378+
assert home_trait.current_map_data is None
379+
assert home_trait.home_map_info == {}
380+
assert home_trait.home_map_content == {}
381+
assert home_trait.current_rooms == []
374382

383+
# Refresh should not change anything
384+
await home_trait.refresh()
385+
assert home_trait.current_map_data is None
375386
assert home_trait.home_map_info == {}
376387
assert home_trait.home_map_content == {}
388+
assert home_trait.current_rooms == []
377389

378390

379391
async def test_refresh_updates_current_map_cache(

0 commit comments

Comments
 (0)