mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2026-10-31 13:52:15 +01:00
Merge origin/main into test/config-records
Both sides added a helper at the end of test/e2e/test_settings.py (boot_time here, header on main); both are kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
afbfac5181
20 changed files with 149 additions and 40 deletions
|
|
@ -86,9 +86,8 @@ def test_a_save_tells_the_other_clients(connect, schema):
|
|||
def test_a_wifi_scan_lists_the_networks(connect, schema):
|
||||
c = connect(schema=schema.hash)
|
||||
_, frames, _ = run_sync(c)
|
||||
header = next(schema.expand(f["d"][schema.keys["header"]]) for f in frames if schema.keys["header"] in f["d"])
|
||||
# The connection in use: Ethernet with WiFi as the fallback may be on either.
|
||||
if header.get("connType") != "Wifi":
|
||||
if header(schema, frames).get("connType") != "Wifi":
|
||||
pytest.skip("the device isn't on WiFi")
|
||||
assert is_ok(schema, op(c, schema, "scanWifi", {}))
|
||||
found = c.recv_until(lambda f: f["t"] == schema.type_numbers["wifiNetworks"], timeout=20)[-1]
|
||||
|
|
@ -159,6 +158,12 @@ def boot_time(schema, frames):
|
|||
return time.time() - uptime(schema, frames) / 1000
|
||||
|
||||
|
||||
def header(schema, frames):
|
||||
"""The header a sync starts with."""
|
||||
key = schema.keys["header"]
|
||||
return next(schema.expand(f["d"][key]) for f in frames if key in f["d"])
|
||||
|
||||
|
||||
def uptime(schema, frames):
|
||||
"""The uptime, in ms, from the status a sync ends with."""
|
||||
key = schema.keys["status"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue