diff options
author | nicolargo <nicolas@nicolargo.com> | 2017-01-28 18:54:27 +0100 |
---|---|---|
committer | nicolargo <nicolas@nicolargo.com> | 2017-01-28 18:54:27 +0100 |
commit | 12412caf56dee8b296d500e201ad6b770eaf2f91 (patch) | |
tree | ebde97ab7eb2462223c39f8b6c92db9749d091fe /unitest.py | |
parent | 1f251f8c68d334f2f55551622dd4a9d4bee0d639 (diff) |
Add GPU to the unitest
Diffstat (limited to 'unitest.py')
-rwxr-xr-x | unitest.py | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -201,6 +201,24 @@ class TestGlances(unittest.TestCase): self.assertTrue(type(stats_grab) is list, msg='IRQ stats is not a list') print('INFO: IRQ stats: %s' % stats_grab) + @unittest.skipIf(not LINUX, "GPU available only on Linux") + def test_013_gpu(self): + """Check GPU plugin.""" + print('INFO: [TEST_014] Check GPU stats') + stats_grab = stats.get_plugin('gpu').get_raw() + self.assertTrue(type(stats_grab) is list, msg='GPU stats is not a list') + print('INFO: GPU stats: %s' % stats_grab) + + def test_095_methods(self): + """Test mandatories methods""" + print('INFO: [TEST_095] Mandatories methods') + mandatories_methods = ['reset', 'update'] + plugins_list = stats.getAllPlugins() + for plugin in plugins_list: + for method in mandatories_methods: + self.assertTrue(hasattr(stats.get_plugin(plugin), method), + msg='{} has no method {}()'.format(plugin, method)) + def test_096_views(self): """Test get_views method""" print('INFO: [TEST_096] Test views') |