summaryrefslogtreecommitdiffstats
path: root/unitest.py
diff options
context:
space:
mode:
authornicolargo <nicolas@nicolargo.com>2017-01-28 18:54:27 +0100
committernicolargo <nicolas@nicolargo.com>2017-01-28 18:54:27 +0100
commit12412caf56dee8b296d500e201ad6b770eaf2f91 (patch)
treeebde97ab7eb2462223c39f8b6c92db9749d091fe /unitest.py
parent1f251f8c68d334f2f55551622dd4a9d4bee0d639 (diff)
Add GPU to the unitest
Diffstat (limited to 'unitest.py')
-rwxr-xr-xunitest.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/unitest.py b/unitest.py
index e9aeb0be..8a3f6ef5 100755
--- a/unitest.py
+++ b/unitest.py
@@ -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')