diff --git a/runtests.py b/runtests.py deleted file mode 100755 index f5a2977..0000000 --- a/runtests.py +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env python - -import unittest - -if __name__ == "__main__": - suite = unittest.TestSuite() - loader = unittest.TestLoader() - suite.addTest(loader.discover("tests/")) - - unittest.TextTestRunner(verbosity=2).run(suite) - -# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 diff --git a/runtests.sh b/runtests.sh new file mode 100755 index 0000000..58521b5 --- /dev/null +++ b/runtests.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +nosetests --rednose -v tests/ diff --git a/tests/modules/__init__.py b/tests/modules/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/modules/test_cpu.py b/tests/modules/test_cpu.py new file mode 100644 index 0000000..3b3fa65 --- /dev/null +++ b/tests/modules/test_cpu.py @@ -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