mirror of
https://github.com/nicolargo/glances.git
synced 2024-08-17 00:10:48 +03:00
Impoprove unittest
This commit is contained in:
parent
9b0d0a7ff0
commit
f224cab225
@ -88,7 +88,7 @@ class TestGlances(unittest.TestCase):
|
||||
|
||||
# Check stats
|
||||
self.assertIsInstance(plugin_instance.get_raw(), (dict, list))
|
||||
if isinstance(plugin_instance.get_raw(), dict):
|
||||
if isinstance(plugin_instance.get_raw(), dict) and plugin_instance.get_raw() != {}:
|
||||
res = False
|
||||
for f in plugin_instance.fields_description:
|
||||
if f not in plugin_instance.get_raw():
|
||||
@ -96,7 +96,7 @@ class TestGlances(unittest.TestCase):
|
||||
else:
|
||||
res = True
|
||||
self.assertTrue(res)
|
||||
elif isinstance(plugin_instance.get_raw(), list):
|
||||
elif isinstance(plugin_instance.get_raw(), list) and len(plugin_instance.get_raw()) > 0:
|
||||
res = False
|
||||
for i in plugin_instance.get_raw():
|
||||
for f in i:
|
||||
@ -592,10 +592,10 @@ class TestGlances(unittest.TestCase):
|
||||
bar.percent = 110
|
||||
self.assertEqual(bar.get(), '|||||||||||||||||||||||||||||||||||||||||||| >100%')
|
||||
|
||||
# def test_100_system_plugin_method(self):
|
||||
# """Test system plugin methods"""
|
||||
# print('INFO: [TEST_100] Test system plugin methods')
|
||||
# self._common_plugin_tests('system')
|
||||
def test_100_system_plugin_method(self):
|
||||
"""Test system plugin methods"""
|
||||
print('INFO: [TEST_100] Test system plugin methods')
|
||||
self._common_plugin_tests('system')
|
||||
|
||||
def test_101_cpu_plugin_method(self):
|
||||
"""Test cpu plugin methods"""
|
||||
@ -623,10 +623,10 @@ class TestGlances(unittest.TestCase):
|
||||
print('INFO: [TEST_105] Test network plugin methods')
|
||||
self._common_plugin_tests('network')
|
||||
|
||||
# def test_106_diskio_plugin_method(self):
|
||||
# """Test diskio plugin methods"""
|
||||
# print('INFO: [TEST_106] Test diskio plugin methods')
|
||||
# self._common_plugin_tests('diskio')
|
||||
def test_106_diskio_plugin_method(self):
|
||||
"""Test diskio plugin methods"""
|
||||
print('INFO: [TEST_106] Test diskio plugin methods')
|
||||
self._common_plugin_tests('diskio')
|
||||
|
||||
def test_107_fs_plugin_method(self):
|
||||
"""Test fs plugin methods"""
|
||||
|
Loading…
Reference in New Issue
Block a user