예제 #1
0
    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()
예제 #2
0
    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()
예제 #3
0
    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()
예제 #4
0
    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]
예제 #5
0
    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]
예제 #6
0
    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()
예제 #8
0
    def test__simple_alert__false__data_user_based(self):
        self.prepare()
        AlertManager.start(self.alert_definition_id)

        self.assert_alert__not_saved()
예제 #9
0
    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()
예제 #10
0
 def test__notif_false__not_alert(self):
     self.prepare()
     AlertManager.start(self.alert_definition_id)
     self.assert_alert__not_saved()