diff options
author | Alessio Sergi <al3hex@gmail.com> | 2015-09-21 15:39:39 +0200 |
---|---|---|
committer | Alessio Sergi <al3hex@gmail.com> | 2015-09-21 15:39:39 +0200 |
commit | 837193ef7bdaf2b37d176cd750235ab0008c2e12 (patch) | |
tree | 711c094e10fefc02117185ae43f1f28ed2892e9a /unitest.py | |
parent | 168969bdf4c973089e3c59cb5efbc892285154fb (diff) |
unitest: unbreak non-Linux platforms
OK FreeBSD, OS X and Windows.
Diffstat (limited to 'unitest.py')
-rwxr-xr-x | unitest.py | 19 |
1 files changed, 5 insertions, 14 deletions
@@ -24,23 +24,9 @@ import sys import time import unittest -from glances.outputs.glances_bars import Bar -from glances.core.glances_globals import ( - appname, - is_linux, - version -) - # Global variables # ================= -# Unitary test is only available from a GNU/Linus machine -if not is_linux: - print('ERROR: Unitaries tests should be ran on GNU/Linux operating system') - sys.exit(2) -else: - print('Unitary tests for {0} {1}'.format(appname, version)) - # Init Glances core from glances.core.glances_main import GlancesMain core = GlancesMain() @@ -52,9 +38,13 @@ if not core.is_standalone(): from glances.core.glances_stats import GlancesStats stats = GlancesStats() +from glances.core.glances_globals import is_windows, version +from glances.outputs.glances_bars import Bar # Unitest class # ============== +print('Unitary tests for Glances %s' % version) + class TestGlances(unittest.TestCase): @@ -115,6 +105,7 @@ class TestGlances(unittest.TestCase): self.assertLessEqual(stats_grab[stat], 100) print('INFO: CPU stats: %s' % stats_grab) + @unittest.skipIf(is_windows, "Load average not available on Windows") def test_004_load(self): """Check LOAD plugin.""" stats_to_check = ['cpucore', 'min1', 'min5', 'min15'] |