fix idempotency gne port uctoff
Some checks failed
CI and deploy / migration-check (push) Failing after 19s
CI and deploy / deploy (push) Has been skipped

This commit is contained in:
Dusan Vojacek
2026-04-29 13:09:43 +02:00
parent 5593397fd3
commit 89fb4f1924
3 changed files with 22 additions and 6 deletions

View File

@@ -21,9 +21,17 @@ def test_drop_registers_keeps_reg178_when_mask_differs():
assert skipped == []
def test_drop_registers_skips_reg179_when_mask_matches():
registers = [(179, "control_board_special_1", 2)] # bits01 = 2 (cutoff ON)
last_verified = {179: 0x1236} # ...0110b => bits01 still == 2
def test_drop_registers_keeps_reg179_when_mask_matches_but_not_clean():
registers = [(179, "control_board_special_1", 2)] # want cutoff ON (clean value)
last_verified = {179: 0x1236} # bits01 still == 2, but not a clean 2/3 value
out, skipped = _drop_registers_matching_last_verified(registers, last_verified)
assert out == registers
assert skipped == []
def test_drop_registers_skips_reg179_when_clean_value_matches():
registers = [(179, "control_board_special_1", 2)] # want cutoff ON (clean value)
last_verified = {179: 2} # already clean cutoff ON
out, skipped = _drop_registers_matching_last_verified(registers, last_verified)
assert out == []
assert skipped == [179]