Skip to content

Commit

Permalink
Enh: Test - Case for #820
Browse files Browse the repository at this point in the history
  • Loading branch information
Sébastien Coavoux committed Mar 31, 2015
1 parent c649d74 commit 098c9b1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/test_escalations.py
Expand Up @@ -111,6 +111,7 @@ def test_simple_escalation(self):
cnn = svc.current_notification_number
print "- 1 x BAD repeat -------------------------------------"
self.scheduler_loop(1, [[svc, 2, 'BAD']], do_sleep=True, sleep_time=0.1)
self.assertIn(True, [n.escalated for n in self.sched.actions.values()])

# Now we raise the notif number of 2, so we can escalade
self.assert_any_log_match('SERVICE NOTIFICATION: level2.*;CRITICAL;')
Expand All @@ -122,16 +123,19 @@ def test_simple_escalation(self):

# One more bad, we go 3
self.scheduler_loop(1, [[svc, 2, 'BAD']], do_sleep=True, sleep_time=0.1)
self.assertIn(True, [n.escalated for n in self.sched.actions.values()])
self.assert_any_log_match('SERVICE NOTIFICATION: level2.*;CRITICAL;')
self.show_and_clear_logs()

# We go 4, still level2
self.scheduler_loop(1, [[svc, 2, 'BAD']], do_sleep=True, sleep_time=0.1)
self.assertIn(True, [n.escalated for n in self.sched.actions.values()])
self.assert_any_log_match('SERVICE NOTIFICATION: level2.*;CRITICAL;')
self.show_and_clear_logs()
# We go 5! we escalade to level3

self.scheduler_loop(1, [[svc, 2, 'BAD']], do_sleep=True, sleep_time=0.1)
self.assertIn(True, [n.escalated for n in self.sched.actions.values()])
self.assert_any_log_match('SERVICE NOTIFICATION: level3.*;CRITICAL;')
self.show_and_clear_logs()

Expand Down

0 comments on commit 098c9b1

Please sign in to comment.