@@ -140,34 +140,6 @@ async def refresh_map() -> None:
140140 self .map .refresh = refresh_map # type: ignore[method-assign]
141141
142142
143- class _FakeQ10PropertiesWithoutMapId :
144- def __init__ (self ) -> None :
145- command = cast (CommandTrait , Mock (spec = CommandTrait ))
146- self .maps = MapsTrait (command )
147- self .map = MapContentTrait (MapDpsTrait (), self .maps , command )
148- self .maps_refresh_count = 0
149- self .map_refresh_count = 0
150-
151- async def refresh_maps () -> None :
152- self .maps_refresh_count += 1
153- self .maps .update_from_dps (
154- {
155- B01_Q10_DP .MULTI_MAP : {
156- "data" : [{"id" : "12345" }],
157- "op" : "list" ,
158- "result" : 1 ,
159- }
160- }
161- )
162-
163- async def refresh_map () -> None :
164- self .map_refresh_count += 1
165- self .map .update_from_trace_packet (parse_trace_packet (TRACE_SESSION_FIXTURE .read_bytes ()))
166-
167- self .maps .refresh = refresh_maps # type: ignore[method-assign]
168- self .map .refresh = refresh_map # type: ignore[method-assign]
169-
170-
171143async def test_await_q10_map_push_waits_for_fresh_update () -> None :
172144 """A cached trace alone is not treated as a successful new map push."""
173145 properties = _FakeQ10Properties ()
@@ -196,21 +168,6 @@ async def test_await_q10_map_push_returns_true_after_update() -> None:
196168 assert len (properties .map .path ) == 14
197169
198170
199- async def test_await_q10_map_push_requests_map_list_only_on_first_use () -> None :
200- """Content gets the list first only when no stored map ID is available."""
201- properties = _FakeQ10PropertiesWithoutMapId ()
202-
203- got_trace = await _await_q10_map_push (
204- cast (Q10PropertiesApi , properties ),
205- lambda : bool (properties .map .path ),
206- timeout = 0.01 ,
207- )
208-
209- assert got_trace is True
210- assert properties .maps_refresh_count == 1
211- assert properties .map_refresh_count == 1
212-
213-
214171async def test_await_q10_map_push_can_fall_back_to_cached_map_on_timeout () -> None :
215172 properties = _FakeQ10Properties ()
216173 properties .map .update_from_map_packet (parse_map_packet (FIXTURE .read_bytes ()))
@@ -286,7 +243,7 @@ async def test_subscribe_loop_routes_trace_push(
286243 assert q10_api .map .robot_position is not None
287244
288245
289- async def test_map_list_and_content_refresh_are_independent (
246+ async def test_map_list_and_current_content_refresh_are_independent (
290247 q10_api : Q10PropertiesApi ,
291248 mock_channel : FakeB01Q10Channel ,
292249 message_queue : asyncio .Queue [Q10Message ],
@@ -320,15 +277,7 @@ async def test_map_list_and_content_refresh_are_independent(
320277
321278 await q10_api .map .refresh ()
322279
323- assert mock_channel .published_commands [1 ] == (
324- B01_Q10_DP .COMMON ,
325- {
326- str (B01_Q10_DP .MULTI_MAP .code ): {
327- "op" : "get" ,
328- "id" : "12345" ,
329- }
330- },
331- )
280+ assert mock_channel .published_commands [1 ] == (B01_Q10_DP .REQUEST_DPS , {})
332281 assert q10_api .maps .current_map_id == "12345"
333282
334283
@@ -355,10 +304,14 @@ async def test_empty_map_list_does_not_request_content(
355304 assert mock_channel .published_commands == []
356305
357306
358- async def test_map_content_refresh_requires_stored_map_id (q10_api : Q10PropertiesApi ) -> None :
359- """Content cannot be requested until the map list supplies an ID."""
360- with pytest .raises (RoborockException , match = "map list is available" ):
361- await q10_api .map .refresh ()
307+ async def test_map_content_refresh_does_not_require_stored_map_id (
308+ q10_api : Q10PropertiesApi ,
309+ mock_channel : FakeB01Q10Channel ,
310+ ) -> None :
311+ """Current-map refresh is read-only and independent of saved-map state."""
312+ await q10_api .map .refresh ()
313+
314+ assert mock_channel .published_commands == [(B01_Q10_DP .REQUEST_DPS , {})]
362315
363316
364317async def test_map_content_refresh_requests_are_not_rate_limited (q10_api : Q10PropertiesApi ) -> None :
0 commit comments