Skip to content

Commit 628a519

Browse files
Added two simple tests.
Signed-off-by: David Rebbe <drebbe@intrepidcs.com>
1 parent 38d3288 commit 628a519

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

test/test_find_devices.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import timeit
2+
3+
print(timeit.timeit("ics.find_devices()", setup="import ics", number=1000))

test/test_get_device_status.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import ics
2+
import time
3+
4+
def print_device_status(s):
5+
for attr_name in dir(s):
6+
if attr_name.startswith('_'):
7+
continue
8+
print(attr_name, " "*(35-len(attr_name)), getattr(s, attr_name))
9+
if attr_name.upper() in ('FIRE2STATUS', 'VCAN4STATUS'):
10+
print()
11+
print_device_status(getattr(s, attr_name))
12+
print()
13+
14+
d = ics.open_device()
15+
time.sleep(0.250) # Give the device time to send the frame
16+
s = ics.get_device_status(d)
17+
print_device_status(s)

0 commit comments

Comments
 (0)