mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2026-10-31 22:02:17 +01:00
test: sync_waits_for_next lets events through
The 30 s memory status could land in its 2 s window and fail it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
dc2f1478b6
commit
9fe05105ff
1 changed files with 10 additions and 5 deletions
|
|
@ -82,12 +82,17 @@ def test_sync_waits_for_next(connect):
|
|||
c.recv() # hello
|
||||
first = c.recv()
|
||||
assert first["t"] == 4
|
||||
# Without next nothing more comes, unless the whole sync fit one frame.
|
||||
try:
|
||||
more = c.recv(timeout=2)
|
||||
except TimeoutError:
|
||||
# Without next no more sync comes, unless the whole sync fit one frame.
|
||||
# Events may come meanwhile, such as the 30 s memory status.
|
||||
while True:
|
||||
try:
|
||||
more = c.recv(timeout=2)
|
||||
except TimeoutError:
|
||||
return
|
||||
if more["t"] >= 128:
|
||||
continue
|
||||
assert more["t"] == 5, "a second sync frame came without next"
|
||||
return
|
||||
assert more["t"] == 5, "a second sync frame came without next"
|
||||
|
||||
|
||||
def test_resync_sends_it_all_again(connect, schema):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue