1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-14 17:22:20 +01:00

tests, address review comments

This commit is contained in:
J. Nick Koston
2025-06-15 20:22:49 -05:00
parent 787ec43266
commit 6fd8c5cee7

View File

@@ -48,40 +48,40 @@ async def test_loop_disable_enable(
if "loop_test_component" not in clean_line: if "loop_test_component" not in clean_line:
return return
log_messages.append(clean_line) log_messages.append(clean_line)
# Track specific events using the cleaned line # Track specific events using the cleaned line
if "[self_disable_10]" in clean_line: if "[self_disable_10]" in clean_line:
if "Loop count:" in clean_line: if "Loop count:" in clean_line:
# Extract loop count # Extract loop count
try:
count = int(clean_line.split("Loop count: ")[1])
self_disable_10_counts.append(count)
except (IndexError, ValueError):
pass
elif "Disabling self after 10 loops" in clean_line:
self_disable_10_disabled.set()
elif "[normal_component]" in clean_line and "Loop count:" in clean_line:
try: try:
count = int(clean_line.split("Loop count: ")[1]) count = int(clean_line.split("Loop count: ")[1])
normal_component_counts.append(count) self_disable_10_counts.append(count)
if count >= 10:
normal_component_10_loops.set()
except (IndexError, ValueError): except (IndexError, ValueError):
pass pass
elif "Disabling self after 10 loops" in clean_line:
self_disable_10_disabled.set()
elif ( elif "[normal_component]" in clean_line and "Loop count:" in clean_line:
"[redundant_enable]" in clean_line try:
and "Testing enable when already enabled" in clean_line count = int(clean_line.split("Loop count: ")[1])
): normal_component_counts.append(count)
redundant_enable_tested.set() if count >= 10:
normal_component_10_loops.set()
except (IndexError, ValueError):
pass
elif ( elif (
"[redundant_disable]" in clean_line "[redundant_enable]" in clean_line
and "Testing disable when will be disabled" in clean_line and "Testing enable when already enabled" in clean_line
): ):
redundant_disable_tested.set() redundant_enable_tested.set()
elif (
"[redundant_disable]" in clean_line
and "Testing disable when will be disabled" in clean_line
):
redundant_disable_tested.set()
# Write, compile and run the ESPHome device with log callback # Write, compile and run the ESPHome device with log callback
async with ( async with (