We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 33ba756 commit 5e099acCopy full SHA for 5e099ac
tests.py
@@ -57,6 +57,7 @@ def test_interval_is_the_same():
57
58
59
def test_setting_interval():
60
+ # Check that setting the interval does change the time the debouncer waits
61
db = adafruit_debouncer.Debouncer(_false, interval=0.01)
62
db.update()
63
@@ -66,13 +67,15 @@ def test_setting_interval():
66
67
db.function = _true
68
db.interval = 0.2
69
70
+ assert db.interval - 0.2 < 0.00001, "interval is not consistent"
71
time.sleep(0.11)
72
73
74
assertEqual(db.value, False)
75
assertEqual(db.rose, False)
76
assertEqual(db.fell, False)
77
78
+ # and then once the whole time has passed make sure it did change
79
80
81
assertEqual(db.value, True)
0 commit comments