1
0
mirror of https://github.com/undera/pylgbst.git synced 2020-11-18 19:37:26 -08:00
This commit is contained in:
Andrey Pokhilko 2019-08-15 13:04:36 +03:00
parent 3a8d17737b
commit 462188b6b2

View File

@ -21,10 +21,10 @@ class PeripheralsTest(unittest.TestCase):
def callback(pressed): def callback(pressed):
vals.append(pressed) vals.append(pressed)
hub.connection.notification_delayed("060001020600", 0.1)
button.subscribe(callback) button.subscribe(callback)
time.sleep(0.1) time.sleep(0.1)
hub.connection.notification_delayed("060001020600", 0.1)
hub.connection.notification_delayed("060001020601", 0.2) hub.connection.notification_delayed("060001020601", 0.2)
hub.connection.notification_delayed("060001020600", 0.3) hub.connection.notification_delayed("060001020600", 0.3)
time.sleep(0.4) time.sleep(0.4)
@ -33,7 +33,7 @@ class PeripheralsTest(unittest.TestCase):
time.sleep(0.1) time.sleep(0.1)
hub.connection.wait_notifications_handled() hub.connection.wait_notifications_handled()
self.assertEqual([False, True, False], vals) self.assertEqual([1, 0], vals)
self.assertEqual(b"0500010202", hub.writes[1][1]) self.assertEqual(b"0500010202", hub.writes[1][1])
self.assertEqual(b"0500010203", hub.writes[2][1]) self.assertEqual(b"0500010203", hub.writes[2][1])