[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:
Tobi-wan Kenobi 2016-12-09 07:27:01 +01:00
parent f40418475f
commit a7e756e015
4 changed files with 47 additions and 23 deletions

View file

@ -1,23 +0,0 @@
# pylint: disable=C0103,C0111
import unittest
from bumblebee.modules.cpu import Module
from tests.util import assertWidgetAttributes
class TestCPUModule(unittest.TestCase):
def setUp(self):
self.module = Module(None)
def test_widgets(self):
widgets = self.module.widgets()
for widget in widgets:
assertWidgetAttributes(self, widget)
def test_update(self):
widgets = self.module.widgets()
self.module.update(widgets)
self.test_widgets()
self.assertEquals(widgets, self.module.widgets())
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4