[tests] Generic module tests
Add a helper function that lists all existing modules and modify the CPU module test so that it now generically iterates all available modules and tests their widgets. see #23
This commit is contained in:
parent
f40418475f
commit
a7e756e015
4 changed files with 47 additions and 23 deletions
|
@ -1,8 +1,21 @@
|
|||
"""Core application engine"""
|
||||
|
||||
import os
|
||||
import time
|
||||
import pkgutil
|
||||
import importlib
|
||||
import bumblebee.error
|
||||
import bumblebee.modules
|
||||
|
||||
def modules():
|
||||
"""Return a list of available modules"""
|
||||
result = []
|
||||
path = os.path.dirname(bumblebee.modules.__file__)
|
||||
for mod in [name for _, name, _ in pkgutil.iter_modules([path])]:
|
||||
result.append({
|
||||
"name": mod
|
||||
})
|
||||
return result
|
||||
|
||||
class Module(object):
|
||||
"""Module instance base class
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue