fix: re-align dead-band on sync
This commit is contained in:
@@ -27,10 +27,21 @@ class TestShouldSend:
|
||||
def test_first_run_always_sends(self, coord):
|
||||
assert coord._should_send(8) is True
|
||||
|
||||
def test_same_value_no_send(self, coord):
|
||||
def test_same_value_no_send_when_recent(self, coord):
|
||||
coord._last_sent_current = 8
|
||||
coord._last_sent_at = datetime.now(timezone.utc)
|
||||
assert coord._should_send(8) is False
|
||||
|
||||
def test_same_value_sends_after_one_minute(self, coord):
|
||||
coord._last_sent_current = 8
|
||||
coord._last_sent_at = datetime.now(timezone.utc) - timedelta(minutes=1, seconds=1)
|
||||
assert coord._should_send(8) is True
|
||||
|
||||
def test_zero_to_zero_never_resends(self, coord):
|
||||
coord._last_sent_current = 0
|
||||
coord._last_sent_at = datetime.now(timezone.utc) - timedelta(minutes=10)
|
||||
assert coord._should_send(0) is False
|
||||
|
||||
def test_zero_to_nonzero_sends(self, coord):
|
||||
coord._last_sent_current = 0
|
||||
assert coord._should_send(8) is True
|
||||
|
||||
Reference in New Issue
Block a user