fix idempotency gne port uctoff
This commit is contained in:
@@ -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)] # bits0–1 = 2 (cutoff ON)
|
||||
last_verified = {179: 0x1236} # ...0110b => bits0–1 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} # bits0–1 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]
|
||||
|
||||
Reference in New Issue
Block a user