[modules/cpu] Add initial version of CPU utilization module

Re-enable the CPU utilization module as proof-of-concept for the new
core engine.

see #23
This commit is contained in:
Tobi-wan Kenobi 2016-12-04 17:45:42 +01:00
parent 8855f1155b
commit aacc56a4e2
9 changed files with 85 additions and 10 deletions

View file

@ -1,13 +1,17 @@
# pylint: disable=C0103,C0111
import unittest
from bumblebee.error import ModuleLoadError
from bumblebee.engine import Engine
from bumblebee.config import Config
from tests.util import MockOutput
class TestEngine(unittest.TestCase):
def setUp(self):
self.engine = Engine(Config())
self.engine = Engine(config=Config(), output=MockOutput())
self.singleWidgetModule = [{"module": "test"}]
self.testModule = "test"
self.invalidModule = "no-such-module"
self.testModuleSpec = "bumblebee.modules.{}".format(self.testModule)
@ -41,4 +45,11 @@ class TestEngine(unittest.TestCase):
[self.testModuleSpec for module in modules]
)
def test_run(self):
self.engine.load_modules(self.singleWidgetModule)
try:
self.engine.run()
except Exception as e:
self.fail(e)
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4