[tests] Added first module tests (for CPU)
I finally *really* need to get started on testing. I've had too many releases in too short time intervals now, all because of small bugs/oversights.
This commit is contained in:
parent
af6055bd83
commit
9c95c0b319
4 changed files with 29 additions and 12 deletions
26
tests/modules/test_cpu.py
Normal file
26
tests/modules/test_cpu.py
Normal file
|
@ -0,0 +1,26 @@
|
|||
import unittest
|
||||
|
||||
import bumblebee.config
|
||||
import bumblebee.modules.cpu
|
||||
|
||||
class FakeOutput(object):
|
||||
def add_callback(self, cmd, button, module=None):
|
||||
pass
|
||||
|
||||
class TestCpuModule(unittest.TestCase):
|
||||
def setUp(self):
|
||||
output = FakeOutput()
|
||||
config = bumblebee.config.Config(["-m", "cpu"])
|
||||
self.cpu = bumblebee.modules.cpu.Module(output, config, None)
|
||||
|
||||
def test_documentation(self):
|
||||
self.assertTrue(hasattr(bumblebee.modules.cpu, "description"))
|
||||
self.assertTrue(hasattr(bumblebee.modules.cpu, "parameters"))
|
||||
|
||||
def test_warning(self):
|
||||
self.assertTrue(hasattr(self.cpu, "warning"))
|
||||
|
||||
def test_critical(self):
|
||||
self.assertTrue(hasattr(self.cpu, "critical"))
|
||||
|
||||
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|
Loading…
Add table
Add a link
Reference in a new issue