Beispiel #1
0
 def test_escalations_contacts_order(self):
     s1 = _make_sub(escalations=[_make_esc(contacts=['1', '2'])])
     s2 = _make_sub(escalations=[_make_esc(contacts=['2', '1'])])
     r = MoiraAlert._subscription_not_changed(s1, s2)
     self.assertTrue(r)
Beispiel #2
0
 def test_escalations_diff_offsets(self):
     s1 = _make_sub(escalations=[_make_esc(20)])
     s2 = _make_sub(escalations=[_make_esc()])
     r = MoiraAlert._subscription_not_changed(s1, s2)
     self.assertFalse(r)
Beispiel #3
0
 def test_escalations_order(self):
     s1 = _make_sub(escalations=[_make_esc(20), _make_esc(10)])
     s2 = _make_sub(escalations=[_make_esc(10), _make_esc(20)])
     r = MoiraAlert._subscription_not_changed(s1, s2)
     self.assertTrue(r)
Beispiel #4
0
 def test_tags_and_contacts_not_equal(self):
     s1 = _make_sub(contacts=['z1', 'c2'], tags=['t1'])
     s2 = _make_sub(contacts=['c1', 'c2'], tags=['t1'])
     r = MoiraAlert._subscription_not_changed(s1, s2)
     self.assertFalse(r)
Beispiel #5
0
 def test_contacts_equal(self):
     s1 = _make_sub(contacts=['c1', 'c2'])
     s2 = _make_sub(contacts=['c1', 'c2'])
     r = MoiraAlert._subscription_not_changed(s1, s2)
     self.assertTrue(r)
Beispiel #6
0
 def test_tags_equal(self):
     s1 = _make_sub(tags=['t1', 't2'])
     s2 = _make_sub(tags=['t1', 't2'])
     r = MoiraAlert._subscription_not_changed(s1, s2)
     self.assertTrue(r)
Beispiel #7
0
 def test_tags_changed(self):
     s1 = _make_sub(tags=['t1'])
     s2 = _make_sub()
     r = MoiraAlert._subscription_not_changed(s1, s2)
     self.assertFalse(r)
Beispiel #8
0
 def test_two_empty(self):
     s1 = _make_sub()
     s2 = _make_sub()
     r = MoiraAlert._subscription_not_changed(s1, s2)
     self.assertTrue(r)