Skip to content

Commit 394d2af

Browse files
committed
extend query tests
Signed-off-by: hwassman <[email protected]>
1 parent f6bcfb5 commit 394d2af

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

tests/test_query.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44

55

66
def my_setup():
7-
global metrics, metrics1
7+
global metrics, metrics1, capSensors
88
metrics = ['cpu_user']
99
metrics1 = ['gpfs_fs_inode_used']
10+
capSensors = ['GPFSDiskCap','GPFSPoolCap', 'GPFSInodeCap']
1011

1112
@with_setup(my_setup)
1213
def test_case01():
@@ -19,3 +20,20 @@ def test_case01():
1920
def test_case02():
2021
query = Query(metrics1)
2122
assert "-ar" in str(query)
23+
query.addMetric('cpu_user')
24+
assert "-ar" in str(query)
25+
26+
@with_setup(my_setup)
27+
def test_case03():
28+
for sensor in capSensors:
29+
query = Query()
30+
query.sensor = sensor
31+
assert "-ar" in str(query)
32+
query = Query()
33+
query.sensor = 'CPU'
34+
assert "-ar" not in str(query)
35+
assert "group" in str(query)
36+
query = Query(includeDiskData=True)
37+
query.sensor = 'GPFSDiskCap'
38+
assert "-ar" in str(query)
39+

0 commit comments

Comments
 (0)