Skip to content

Commit

Permalink
Merge pull request #85 from drewkerrigan/extend-tests
Browse files Browse the repository at this point in the history
Extend tests for array syntax
  • Loading branch information
martialblog authored Mar 22, 2024
2 parents dddf843 + 27c710b commit ce9c5fd
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 ce9c5fd

Please sign in to comment.