Processlist ok

This commit is contained in:
nicolargo 2025-07-06 22:47:33 +02:00
parent 660b94e99d
commit 365a670c12
1 changed files with 19 additions and 0 deletions

View File

@ -53,3 +53,22 @@ def test_glances_api_plugin_network():
assert len(keys) > 0
# Check that the first item is a dictionary
assert isinstance(gl.network[keys[0]], dict)
def test_glances_api_plugin_process():
gl.processcount.update()
# Get list of keys (processes)
keys = gl.processcount.keys()
# Check that the keys are not empty
assert len(keys) > 0
# Check that processcount total is > 0
assert gl.processcount['total'] > 0
# Note should be done after processcount update
gl.processlist.update()
# Get list of keys (processes)
keys = gl.processlist.keys()
# Check that first key is an integer (PID)
assert isinstance(keys[0], int)
# Check that the first item is a dictionary
assert isinstance(gl.processlist[keys[0]], dict)