def test_that_tide_prediction_alerts_can_be_disabled(self):
        self._make_bad_tide_location()

        with freeze_time(BASE_TIME):
            disable_alert_until(self.liverpool, AlertType.tide_predictions,
                                BASE_TIME + datetime.timedelta(hours=1))
            (ok, text) = check_tide_predictions(self.liverpool)

        assert_equal(True, ok)
        assert_equal('OK (alert disabled)', text)
Ejemplo n.º 2
0
    def test_that_observations_alerts_can_be_disabled(self):
        self._make_bad_observations()

        with freeze_time(BASE_TIME):
            disable_alert_until(self.liverpool, AlertType.observations,
                                BASE_TIME + datetime.timedelta(hours=1))
            (ok, text) = check_observations(self.liverpool)

        assert_equal(True, ok)
        assert_equal('OK (alert disabled)', text)
Ejemplo n.º 3
0
 def test_that_schedule_alerts_can_be_disabled(self):
     now = now_rounded()
     with freeze_time(now):
         disable_alert_until(self.origin, AlertType.schedule,
                             delta(hours=1))
         self.assert_status(True, 'OK (alert disabled)', self.origin)
 def test_that_schedule_alerts_can_be_disabled(self):
     now = now_rounded()
     with freeze_time(now):
         disable_alert_until(self.origin, AlertType.schedule,
                             delta(hours=1))
         self.assert_status(True, 'OK (alert disabled)', self.origin)
Ejemplo n.º 5
0
 def _disable(self, alert_type):
     disable_alert_until(self.liverpool, alert_type,
                         BASE_DATE + datetime.timedelta(hours=10))
Ejemplo n.º 6
0
 def test_that_weather_observations_alerts_can_be_disabled(self):
     now = now_rounded()
     with freeze_time(now):
         disable_alert_until(self.location, AlertType.weather_predictions,
                             delta(hours=1))
         self.assert_status(True, 'OK (alert disabled)', self.location)