-
Notifications
You must be signed in to change notification settings - Fork 5
/
test.py
29 lines (23 loc) · 1.15 KB
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env python
from MainControlLoop.tests.system_tests.APRS import APRSDriverTest
from MainControlLoop.tests.system_tests.Iridium import IridiumDriverTest
import inspect
MODULES = {}
# List of tuples: (name, class).
hardware_modules_list = [("APRS", APRSDriverTest), ("Iridium", IridiumDriverTest)]
software_modules_list = []
# Test script runs all methods in class.
if __name__ == '__main__':
for name_type, type_list in [("hardware", hardware_modules_list), ("software", software_modules_list)]:
for name, moduleClass in type_list:
if input(f"Run {name_type} tests for test {name}? (Y/N): ").lower() == "y":
f = moduleClass()
attrs = (getattr(f, name) for name in dir(f))
methods = filter(inspect.ismethod, attrs)
for method in methods:
if input(f"Run method '{method.__name__}' in {name_type} test for {name}? (Y/N): ").lower() == "y":
try:
print(f"Running method '{method.__name__}'")
method()
except TypeError:
pass