diff --git a/tests.py b/tests.py index 775c45f..a8c2fef 100644 --- a/tests.py +++ b/tests.py @@ -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 @@ -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