def test__notif_false__time_between(self): self.last_notification_time = self.today - timedelta(days=5) self.prepare() AlertManager.start(self.alert_definition_id) self.assert_alert__saved()
def test__notif_true__with_data(self): self.last_notification_time = self.today - timedelta(days=20) self.prepare() AlertManager.start(self.alert_definition_id) self.assert_alert__saved()
def test__notif_true__no_data(self): self.last_notification_time = None self.is_index = True self.prepare() AlertManager.start(self.alert_definition_id) self.assert_alert__saved()
def test__simple_alert__true__data_last_check__accept_false__value_user_based__average__equal(self): self.prepare() AlertManager.start(self.alert_definition_id) columns_name, results = self.assert_alert__saved() # Data check index = columns_name.index("data") assert mean(self.donnee_comptage_list) == results[index] # Value check index = columns_name.index("value") assert self.value_number == results[index]
def test__simple_alert__true__data_user_based(self): self.prepare() AlertManager.start(self.alert_definition_id) result_expected = self.donnee_comptage_list[:2] value_number = max(result_expected) columns_name, results = self.assert_alert__saved() # Data check index = columns_name.index("data") assert max(result_expected) == results[index] # Value check index = columns_name.index("value") assert value_number == results[index]
def test__simple_alert__true__data_last_check__not_all(self): self.last_check = self.today - timedelta(days=2) self.donnee_comptage_delta = timedelta(days=1) self.prepare() AlertManager.start(self.alert_definition_id) result_expected = self.donnee_comptage_list[:2] value_number = max(result_expected) columns_name, results = self.assert_alert__saved() # Data check index = columns_name.index("data") assert max(result_expected) == results[index] # Value check index = columns_name.index("value") assert value_number == results[index]
def test_it(self, insert_data=True): if insert_data: self.insert_defined_data() AlertManager.start()
def test__simple_alert__false__data_user_based(self): self.prepare() AlertManager.start(self.alert_definition_id) self.assert_alert__not_saved()
def test__simple_alert__false__data_last_check__accept_false__value_user_based__max__equal(self): self.prepare() AlertManager.start(self.alert_definition_id) self.assert_alert__not_saved()
def test__notif_false__not_alert(self): self.prepare() AlertManager.start(self.alert_definition_id) self.assert_alert__not_saved()