mirror of
https://github.com/drewkerrigan/nagios-http-json.git
synced 2024-11-22 02:13:47 +01:00
Merge pull request #85 from drewkerrigan/extend-tests
Extend tests for array syntax
This commit is contained in:
commit
ce9c5fdada
@ -110,6 +110,14 @@ class UtilTest(unittest.TestCase):
|
|||||||
self.check_data(RulesHelper().dash_U(['metric,0']),
|
self.check_data(RulesHelper().dash_U(['metric,0']),
|
||||||
'{"metric": 3}', UNKNOWN_CODE)
|
'{"metric": 3}', UNKNOWN_CODE)
|
||||||
|
|
||||||
|
def test_array(self):
|
||||||
|
self.check_data(RulesHelper().dash_q(['foo(0),bar']),
|
||||||
|
'{"foo": ["bar"]}', OK_CODE)
|
||||||
|
self.check_data(RulesHelper().dash_q(['foo(0),foo']),
|
||||||
|
'{"foo": ["bar"]}', WARNING_CODE)
|
||||||
|
self.check_data(RulesHelper().dash_Q(['foo(1),bar']),
|
||||||
|
'{"foo": ["bar"]}', CRITICAL_CODE)
|
||||||
|
|
||||||
def test_exists(self):
|
def test_exists(self):
|
||||||
self.check_data(RulesHelper().dash_e(['nothere']),
|
self.check_data(RulesHelper().dash_e(['nothere']),
|
||||||
'{"metric": 5}', WARNING_CODE)
|
'{"metric": 5}', WARNING_CODE)
|
||||||
|
Loading…
Reference in New Issue
Block a user