Skip to content

Commit e7bcb14

Browse files
author
NOisi-X
committed
fix: update A01 device test snapshots and use fixed timestamp for deterministic results
1 parent 99c2b53 commit e7bcb14

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

test_result.txt

4.66 KB
Binary file not shown.

tests/e2e/__snapshots__/test_device_manager.ambr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
00000020 64 75 69 64 00 41 30 31 00 00 23 82 00 00 23 83 |duid.A01..#...#.|
1919
00000030 68 a6 a2 24 00 65 00 30 c5 de 2b f6 a9 ba 32 7e |h..$.e.0..+...2~|
2020
00000040 6b 73 82 bb d8 67 d4 db 7d 80 60 67 80 96 b8 a1 |ks...g..}.`g....|
21-
00000050 c6 bc 9e d2 da 07 fb d3 1d 80 db 56 f2 96 82 fe |...........V....|
22-
00000060 27 a5 31 29 05 b8 89 50 b3 94 d0 cd |'.1)...P....|
21+
00000050 c6 bc 9e d2 da 07 fb d3 79 f5 6f 6d 04 9c 71 00 |........y.om..q.|
22+
00000060 48 66 3d 7e 5d fe d3 df 18 e4 26 38 |Hf=~].....&8|
2323
[mqtt <]
2424
00000000 30 5e 00 20 72 72 2f 6d 2f 6f 2f 75 73 65 72 31 |0^. rr/m/o/user1|
2525
00000010 32 33 2f 31 39 36 34 38 66 39 34 2f 7a 65 6f 5f |23/19648f94/zeo_|

tests/e2e/test_device_manager.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import syrupy
1818
from Crypto.Cipher import AES
1919
from Crypto.Util.Padding import pad
20-
from freezegun import freeze_time
2120

2221
from roborock.data.b01_q7 import WorkStatusMapping
2322
from roborock.data.b01_q10.b01_q10_code_mappings import B01_Q10_DP
@@ -513,8 +512,8 @@ async def test_q7_device(
513512
)
514513
],
515514
)
516-
@freeze_time("2025-01-20T12:00:00", tick=True)
517515
async def test_a01_device(
516+
monkeypatch: Any,
518517
mock_rest: Any,
519518
push_mqtt_response: Callable[[bytes], None],
520519
log: CapturedRequestLog,
@@ -523,6 +522,8 @@ async def test_a01_device(
523522
snapshot: syrupy.SnapshotAssertion,
524523
) -> None:
525524
"""Test the device manager end to end flow with an A01 device."""
525+
# Use a fixed timestamp so the MQTT payload snapshot is deterministic.
526+
monkeypatch.setattr("roborock.protocols.a01_protocol.time.time", lambda: 1755750947.0)
526527
# Prepare MQTT requests
527528
response_builder = ResponseBuilder()
528529
response_builder.version = A01_VERSION

0 commit comments

Comments
 (0)