Skip to content

Commit

Permalink
Extend tests for array syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
martialblog committed Mar 22, 2024
1 parent dddf843 commit 27c710b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/test_check_http_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,14 @@ def test_unknown(self):
self.check_data(RulesHelper().dash_U(['metric,0']),
'{"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):
self.check_data(RulesHelper().dash_e(['nothere']),
'{"metric": 5}', WARNING_CODE)
Expand Down

0 comments on commit 27c710b

Please sign in to comment.