Skip to content

Commit

Permalink
test(Check): test check creation not in grace period
Browse files Browse the repository at this point in the history
- when a new check is created, esnure it is not in grace period

[Delivers #150627412]
  • Loading branch information
Ashaba committed Sep 2, 2017
1 parent 68d73d9 commit 1e760e7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions hc/api/tests/test_check_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,16 @@ def test_it_strips_tags(self):
self.assertEqual(len(check.tags_list()), 0)

def test_status_works_with_grace_period(self):
"""test for check status and the grace period"""
check = Check()

check.status = "up"
check.last_ping = timezone.now() - timedelta(days=1, minutes=30)

self.assertTrue(check.in_grace_period())
self.assertEqual(check.get_status(), "up")

### The above 2 asserts fail. Make them pass

def test_paused_check_is_not_in_grace_period(self):
""" Test that when a new check is created, it is not in the grace period"""
check = Check()

check.status = "up"
Expand All @@ -38,4 +37,3 @@ def test_paused_check_is_not_in_grace_period(self):
check.status = "paused"
self.assertFalse(check.in_grace_period())

### Test that when a new check is created, it is not in the grace period

0 comments on commit 1e760e7

Please sign in to comment.