Skip to content

Commit

Permalink
del test case
Browse files Browse the repository at this point in the history
  • Loading branch information
delong1 committed Jun 27, 2016
1 parent f033eb0 commit 475b8e4
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ def test_multiexpressions(reactor):

assert list(alert.history['metric1']) == [85, 65, 68, 75]


def test_invalid_handler(reactor):
reactor.reinit(critical_handlers=['log', 'unknown'])
assert len(reactor.handlers['critical']) == 1
Expand Down Expand Up @@ -262,16 +263,6 @@ def test_parse_rule():
op.and_,
{'op': op.gt, 'value': 25, 'mod': IDENTITY}]}

assert parse_rule('warning: >= comparison') == {
'level': 'warning', 'raw': 'warning: >= comparison',
'exprs': [{'op': op.ge, 'value': 'comparsion', 'mod': IDENTITY}]}

assert parse_rule('warning: >= comparison AND > 30') == {
'level': 'warning', 'raw': 'warning: >= comparison AND > 30',
'exprs': [{'op': op.ge, 'value': 'comparison', 'mod': IDENTITY},
op.and_,
{'op': op.gt, 'value': 30, 'mod': IDENTITY}]}

rule = parse_rule('warning: >= historical * 1.2')
assert rule['exprs'][0]['mod']
assert rule['exprs'][0]['mod'](5) == 6
Expand Down

0 comments on commit 475b8e4

Please sign in to comment.